drift
drift copied to clipboard
[SQLParser] Add schema-name functionnality
SQLite can have a schema-name before some SQL command like SELECT or CREATE TABLE

This is the database alias used when you ATTACH a database.
Do you think SQLParser could be able to manage this property ?
I think this should be possible, but it's a large effort. For what exactly do you need this? Are you using sqlparser directly to analyze queries? Do you need this feature in moor files?
We work on multiple databases on a single database connection. So we always prefix our queries with schema-name (even if only one database is connected: with schema-name "main." prefix).
We do not not need this feature in moor files, only for direct analyse.
I've added support for this to the parser, the AST classes and the node-to-text formatter in aa75cbaa198e5e19f2e54dbcc0033aab47ba634a. I'll still have to work on proper analysis.