Skip to content

Commit 9350ff9

Browse files
committed
Generalize to sqlean_% tables.
1 parent 9e227e4 commit 9350ff9

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

litecli/packages/special/dbcommands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ def list_tables(cur, arg=None, arg_type=PARSED_QUERY, verbose=False):
2727
args = ("{0}%".format(arg),)
2828
query = """
2929
SELECT name FROM sqlite_master
30-
WHERE type IN ('table','view') AND name LIKE ? AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_define'
30+
WHERE type IN ('table','view') AND name LIKE ? AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_%'
3131
ORDER BY 1
3232
"""
3333
else:
3434
args = tuple()
3535
query = """
3636
SELECT name FROM sqlite_master
37-
WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_define'
37+
WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_%'
3838
ORDER BY 1
3939
"""
4040

@@ -69,14 +69,14 @@ def list_views(cur, arg=None, arg_type=PARSED_QUERY, verbose=False):
6969
args = ("{0}%".format(arg),)
7070
query = """
7171
SELECT name FROM sqlite_master
72-
WHERE type = 'view' AND name LIKE ? AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_define'
72+
WHERE type = 'view' AND name LIKE ? AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_%'
7373
ORDER BY 1
7474
"""
7575
else:
7676
args = tuple()
7777
query = """
7878
SELECT name FROM sqlite_master
79-
WHERE type = 'view' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_define'
79+
WHERE type = 'view' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_%'
8080
ORDER BY 1
8181
"""
8282
log.debug(query)

litecli/packages/special/llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def sql_using_llm(cur, question=None, verbose=False) -> Tuple[str, Optional[str]
308308
"""
309309
tables_query = """
310310
SELECT name FROM sqlite_master
311-
WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_define'
311+
WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_%'
312312
ORDER BY 1
313313
"""
314314
click.echo("Preparing schema information to feed the llm")

litecli/sqlexecute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ class SQLExecute(object):
3333
tables_query = """
3434
SELECT name
3535
FROM sqlite_master
36-
WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_define'
36+
WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'sqlean_%'
3737
ORDER BY 1
3838
"""
3939

4040
table_columns_query = """
4141
SELECT m.name as tableName, p.name as columnName
4242
FROM sqlite_master m
4343
JOIN pragma_table_info((m.name)) p
44-
WHERE m.type IN ('table','view') AND m.name NOT LIKE 'sqlite_%' AND m.name NOT LIKE 'sqlean_define'
44+
WHERE m.type IN ('table','view') AND m.name NOT LIKE 'sqlite_%' AND m.name NOT LIKE 'sqlean_%'
4545
ORDER BY tableName, columnName
4646
"""
4747

0 commit comments

Comments
 (0)