Does SQLDelight give me a way to access a list of ...
# squarelibraries
g
Does SQLDelight give me a way to access a list of table names in the schema? Looking at the generated database class, it contains a bunch of calls to the driver with the
CREATE TABLE
statements, but nothing like a plain list of table names. Would any of SQLDelight’s Gradle tasks help me generate this list, or do I need to do my own schema parsing?
d
It might differ if you're not using SQLite, but you could write a SQL query that gets you a list of all the tables?
Copy code
SELECT name FROM sqlite_master WHERE type='table';
g
Thanks, I thought about that, but that may not work for my use case if the database hasn’t been created (or migrated) yet. I really need it to be generated at build time.
d
Ah I see. There's nothing like that in SQLDelight today, but there is a very broad idea of potentially creating some kind of SQLDelight plugin API where you could create plugins for the SQLDelight compiler/codegen to do custom things which could hypothetically accomplish this kind of thing. It's not actively being worked on at the moment though.
👍 1