Hello World
Also known as "Your First Table"
Last updated
Also known as "Your First Table"
Last updated
You will create a table called books
You will insert a row
You will query the inserted row
After having set-up your environment, we will create a table called books. For this, we will create a file named books.ts
inside your tables
folder. It will look like this:
After having created our table, we will run the engine by executing the following terminal command from the root of where our SchemaJS.toml
is.
Running
start
will open up a REPL after having initialized our database.
In our REPL, we will type use
to access the table. For this, we will first need to access the database and then the table context.
use("public")
use("books")
and finally, after being in the context of the table books, we will proceed to run the following Javascript code.
Finally, to query a row, we can run the following JS command: