mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
Fix .schema users not displaying indexes on the users table
This commit is contained in:
@@ -201,7 +201,7 @@ fn display_schema(
|
||||
) -> anyhow::Result<()> {
|
||||
let sql = match table {
|
||||
Some(table_name) => format!(
|
||||
"SELECT sql FROM sqlite_schema WHERE type='table' AND name = '{}' AND name NOT LIKE 'sqlite_%'",
|
||||
"SELECT sql FROM sqlite_schema WHERE type IN ('table', 'index') AND tbl_name = '{}' AND name NOT LIKE 'sqlite_%'",
|
||||
table_name
|
||||
),
|
||||
None => String::from(
|
||||
|
||||
@@ -5,7 +5,7 @@ source $testdir/tester.tcl
|
||||
|
||||
do_execsql_test schema {
|
||||
.schema
|
||||
} {{CREATE TABLE users (
|
||||
} {"CREATE TABLE users (
|
||||
id INTEGER PRIMARY KEY,
|
||||
first_name TEXT,
|
||||
last_name TEXT,
|
||||
@@ -21,12 +21,12 @@ CREATE TABLE products (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT,
|
||||
price REAL
|
||||
);}
|
||||
"CREATE INDEX age_idx on users (age);"}
|
||||
);
|
||||
CREATE INDEX age_idx on users (age);"}
|
||||
|
||||
do_execsql_test schema-1 {
|
||||
.schema users
|
||||
} {{CREATE TABLE users (
|
||||
} {"CREATE TABLE users (
|
||||
id INTEGER PRIMARY KEY,
|
||||
first_name TEXT,
|
||||
last_name TEXT,
|
||||
@@ -37,7 +37,8 @@ do_execsql_test schema-1 {
|
||||
state TEXT,
|
||||
zipcode TEXT,
|
||||
age INTEGER
|
||||
);}}
|
||||
);
|
||||
CREATE INDEX age_idx on users (age);"}
|
||||
|
||||
do_execsql_test schema-2 {
|
||||
.schema products
|
||||
|
||||
Reference in New Issue
Block a user