#731·kysely

Allow inserts to alias table names

Author: mezuzzaCreated Oct 12, 2023Updated Aug 13, 2026
Labelsenhancementgood first issuesqlitepostgresapigreenlit

I'm not sure if all DBs allow this, but at least in postgres you can alias the table. The specific part of the spec that I'm referencing is this:

INSERT INTO table_name [ AS alias ]

So I can write

INSERT INTO some_schema.some_table AS some_alias (col1)
VALUES (1)

Since QueryCreator.insertInto doesn't have any overrides for AnyAliasedTable, there doesn't seem to be a way to do this.