-
Notifications
You must be signed in to change notification settings - Fork 0
Command Line
Sylvain Bernard edited this page Dec 10, 2015
·
1 revision
# CREATE
Creates a database. Note that creating a database does not persist it across sessions. Use the SAVE command to save a database to file.
jsdb> CREATE DATABASE db
Database db successfully created!
Creates a table.
jsdb> CREATE TABLE Users (name, email, phone, age, sex)
Table Users successfully created for database db
# SHOW
Displays a list of loaded databases in the current session.
jsdb> SHOW DATABASES
Databases
---------
db
# DESCRIBE
Outputs information about a database.
jsdb> DESCRIBE DATABASE db
Database: db
Created: December 9, 2015 2:25 PM
Path: null
Modified: true
Tables:
-------
Users
Outputs information about a table.
jsdb> DESCRIBE TABLE Users
Table: Users
Created: December 9, 2015 2:26 PM
Columns:
--------
_id
name
email
phone
age
sex
Number of rows: 0
# USE
Selects a database for the current session.
jsdb> USE db
Database changed to db
# SAVE
Saves a database to disk. It writes the file to the user's home folder using the database's name and a .jsdb extension.
jsdb> SAVE db
Database db was successfully saved in /home/srbdev/db.jsdb
# LOAD
Loads a database into the current session. It requires a full path and a database file with a .jsdb extension.
jsdb> LOAD /home/srbdev/db.jsdb
Database db loaded!