This Howto will show you how to create a SQL table with a SQL file that contains a CREATE SQL statement with the Tabli table create command.
You should have Tabulify installed on your computer: Learning Tabulify - Step 1 - Installation
We will execute the below SQL Script that is located in the howto connection.
-- Create the foo table statement
create table foo (
bar integer
)
With the tabli data create command, if you use a script selector as first argument, the selected script are executed.
To execute the previous SQL script, the below the command should be executed:
tabli data create (create_foo.sql@howto)@sqlite
where:
The list of create script data resources executed:
uri
-----------------------------
(create_foo.sql@howto)@sqlite
Check the metadata with the tabli data meta command
tabli data struct foo@sqlite
Position Column Name Data Type Primary Key Not Null Auto Increment Description
-------- ----------- --------- ----------- -------- -------------- -----------
1 bar integer x false
You can also create a table and its dependencies (foreign tables) at once with the tabli data create command.