SeaQL / sea-query

🔱 A dynamic SQL query builder for MySQL, Postgres and SQLite
https://www.sea-ql.org
Other
1.13k stars 185 forks source link

postgres: Support creating partitioned tables #722

Open gitmalong opened 9 months ago

gitmalong commented 9 months ago

I'd love to see SeaQuery support creating partitioned Postgres tables.

Motivation

Partitioned Postgres tables help to scale Postgres / can drastically improve performance on large data sets.

Proposed Solutions

For a full blown partition support there are some more expressions that need to be supported but I think the support for creating tables with PARTITION BY RANGE is already a good starting point. Hence this issue is just about that.

CREATE TABLE measurement (
    city_id         int not null,
    logdate         date not null,
) PARTITION BY RANGE (logdate);

Additional Information

This issue blocks https://github.com/SeaQL/sea-orm/issues/1962