Taylor Beever
Taylor Beever
Ah I figured out the initial issue... I am using a `BaseTable` class that inherits from `Table` in order to add utility methods. The base class was generating the `id`...
Further update the following appears to work but the order of the Mixins is critical (at least for some of the methods we wrote). ```python class BaseTable: @classmethod async def...
I think it would be really helpful to be able to nest `QueryString` objects as well. This would make passing the parameters easier to construct as well and I think...
Not sure if relevant or already addressed by this but when doing an `Table.insert(Table(jsonb_column=None))` Piccolo doesn't appear to encode the value as a SQL `NULL` value which makes `NOT NULL`...
Maybe a `SQL_NULL` delegate so the ORM knows to add it to the query as `NULL` without quoting it?
Tested with setting the column default to `None` and that value is appropriately set to a SQL `NULL` so this only occurs when doing an `INSERT` with a `None`.
With the risk of having too many configurable arguments... I think `None` *always* being SQL `NULL` is a bit more consistent. That way devs can rely on the `NOT NULL`...
Another option for the coercion could be... ```python class Table(Table): jsonb_col = JSONB(none_as_null=True)` ```
Also I promise to stop hammering on the json stuff soon but noted this as well... This works... ```python await Table.raw( """ INSERT INTO table (jsonb_column) VALUES ({}) """, '{"hello":...
Yeah I see what you mean... Not a lot of options there. Shame there isn't some combination of Template and Formatter. Expounding on the above example when providing multiple values...