Skip to content
Snippets Groups Projects
Commit c69497cf authored by Wellington Gabriel Vicente de Souza's avatar Wellington Gabriel Vicente de Souza
Browse files

add more info to readme

parent f18dbbca
No related branches found
No related tags found
No related merge requests found
# STEAMDB V0.0.1 # STEAMDB V0.0.1
### dependencies: latest version of ruby (2.5.0), active\_record gem, sqlite3 gem ### dependencies: latest version of ruby (2.5.0), active\_record gem, sqlite3 gem
## Introduction ## Introduction
Hi! This is a project made for the second evaluation of the Tópicos em Programação de Computadores (CI320) course at Universidade Federal do Paraná in Brazil. Hi! This is a project made for the second evaluation of the Tópicos em Programação de Computadores (CI320) course at Universidade Federal do Paraná in Brazil.
This project simulates a simplified working database management system similar to sqlite3. It was implemented in the Ruby language and it uses the Active Record gem to establish a connection with sqlite3. This project simulates a simplified working database management system similar to sqlite3. It was implemented in the Ruby language and it uses the Active Record gem to establish a connection with sqlite3.
## How to use ## How to use
### Creating the database ### Creating the database
To create the tables defined in the schema.rb file, run: To create the tables defined in the schema.rb file, run:
$ ruby schema.rb $ ruby schema.rb
The steamdb.sqlite3 file on this repository already contains a few example rows to simplify the testing of the different functionalities. To reset the entire database, simply delete the steamdb.sqlite3 file and run the schema.rb file again. The steamdb.sqlite3 file on this repository already contains a few example rows to simplify the testing of the different functionalities. To reset the entire database, simply delete the steamdb.sqlite3 file and run the schema.rb file again.
The models for each object type are defined in the models.rb file. This database system implements 1 to 1, 1 to n and n to n relationships. The models for each object type are defined in the models.rb file. This database system implements 1 to 1, 1 to n and n to n relationships.
### Running SteamDB ### Running SteamDB
To run SteamDB, just enter the following command on your terminal: To run SteamDB, just enter the following command on your terminal:
$ ruby steamdb.rb $ ruby steamdb.rb
### Instructions ### Instructions
...@@ -26,4 +26,29 @@ This program contains four basic functionalities: ...@@ -26,4 +26,29 @@ This program contains four basic functionalities:
- altera (update one or more elements) - altera (update one or more elements)
- lista (list all the elements of a table) - lista (list all the elements of a table)
### Command syntax ### Command syntax
< op > < table > < { attribute=value } >
possible < op > values are insere, exclui, altera and lista
< table > indicates the name of the table you will be using for the operation
{ ... } indicates the possibility of more than one argument
attribute=value has different meanings, acting both as a WHERE select and as an attribution
To clarify, here are some examples:
Creating the developer named Jose that lives in Brasil:
+ insere developers name="jose" country="brasil"
Listing all the developers
+ lista developers
Changing the name and country values of the row(s) with a "Jose" value on the name column
+ altera developers name="jose" name="joão" country="usa"
Observation: in the "altera" operation, the first (and only the first) attribute=value pair is used to select one or more rows with the defined value
Deleting a row
+ exclui developers name="joão" country="usa"
Deleting all rows of a table
+ exclui developers
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment