for example I defined a table
create table demo_tab (
name text not null unique,
phone_number text not null check(phone_number like \'9%\')
);
You can retrieve the SQL that was used to create the table from sqlite_master
:
sqlite> create table demo_tab (
...> name text not null unique,
...> phone_number text not null check(phone_number like '9%')
...> );
sqlite> select sql from sqlite_master where type='table' and name='demo_tab';
CREATE TABLE demo_tab (
name text not null unique,
phone_number text not null check(phone_number like '9%')
)