Tabulify - How to create a table with a CREATE Sql statement file

Tabulify - How to create a table with a CREATE Sql statement file

About

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.

Steps

Prerequisites

You should have Tabulify installed on your computer: Learning Tabulify - Step 1 - Installation

The CREATE table statement

We will execute the below SQL Script that is located in the howto connection.

-- Create the foo table statement

create table foo (
  bar integer
)

The data create command

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 ([email protected])@sqlite

where:

The list of create script data resources executed:
uri                             
-----------------------------   
([email protected])@sqlite

Check the metadata

Check the metadata with the tabli data meta command

tabli data struct [email protected]
Position   Column Name   Data Type   Primary Key   Not Null   Auto Increment   Description   
--------   -----------   ---------   -----------   --------   --------------   -----------   
1          bar           integer                   x          false

Next

You can also create a table and its dependencies (foreign tables) at once with the tabli data create command.

How to copy a star/snowflake schema ?

Powered by ComboStrap