Fix .schema

- Add tests for .schema
- Make command line sql arguments to allow .commands
This commit is contained in:
Bennett Clement
2024-07-22 11:08:14 +08:00
parent 0f85c36416
commit 5b4bdc8aa3
4 changed files with 40 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
set testdir [file dirname $argv0]
source $testdir/cmdlineshell.test
source $testdir/agg-functions.test
source $testdir/coalesce.test
source $testdir/join.test

28
testing/cmdlineshell.test Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env tclsh
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_execsql_test schema-1 {
.schema users
} {{CREATE TABLE users (
id INTEGER PRIMARY KEY,
first_name TEXT,
last_name TEXT,
email TEXT,
phone_number TEXT,
address TEXT,
city TEXT,
state TEXT,
zipcode TEXT,
age INTEGER
);}}
do_execsql_test schema-2 {
.schema products
} {{CREATE TABLE products (
id INTEGER PRIMARY KEY,
name TEXT,
price REAL
);}}