SQL.py - Add functions for listing indexes.
Not used anywhere - may be a good reference at some point
This commit is contained in:
parent
212438a0c6
commit
12ad272f91
|
@ -51,6 +51,18 @@ class Sql:
|
||||||
WHERE type='table'
|
WHERE type='table'
|
||||||
ORDER BY name;"""
|
ORDER BY name;"""
|
||||||
|
|
||||||
|
################################
|
||||||
|
# List indexes
|
||||||
|
################################
|
||||||
|
if db_server == 'mysql':
|
||||||
|
self.query['list_tables'] = """SHOW INDEXES"""
|
||||||
|
elif db_server == 'postgresql':
|
||||||
|
self.query['list_tables'] = """SELECT tablename, indexname FROM PG_INDEXES"""
|
||||||
|
elif db_server == 'sqlite':
|
||||||
|
self.query['list_tables'] = """SELECT name FROM sqlite_master
|
||||||
|
WHERE type='index'
|
||||||
|
ORDER BY name;"""
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
# Drop Tables - MySQL, PostgreSQL and SQLite all share same syntax
|
# Drop Tables - MySQL, PostgreSQL and SQLite all share same syntax
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
Loading…
Reference in New Issue
Block a user