Is there a way to dynamically switch between table...
# squarelibraries
j
Is there a way to dynamically switch between tables that have the exact same schema but different names in SQL Delight? I have a database with one table per language I'm wondering whether it would be feasible to switch between tables when the user selects a language (I'm not sure how to go about doing that since the schema classes are automatically generated and are named the same as the table, so it doesn't seem like a generic class name can be used).
d
Why not use a single table with an addition column?
j
@Dominaezzz Thank you for the suggestion! I did think of doing that but it won't work for my purpose. There needs to be one table per language.
d
Well, there's also the option of using a
VIEW
? Then you can alter the view to point to any of the tables.