This is about SQLDelight: Is there a convenient wa...
# squarelibraries
s
This is about SQLDelight: Is there a convenient way to generate a couple of default functions for all tables? E.g.
getAll
,
getById(id)
,
deleteById
, etc. I find myself writing them in the sq files for most tables anyway, and that is copy-pasting I'd like to avoid. I know this is predicated on some conditions, like having a atomic
id
property, etc. But again, I find myself writing tables mostly compatible.
d
The plugin does this for you with code generation and live templates. Right click on a table, then select "Generate" from the popup menu, then pick the option, like "Select By Primary Key", and the plugin automatically generates the
selectById:
query.
s
That helps, thanks!