Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CREATE TABLE PARTITION OF #825

Open
hypnoglow opened this issue May 4, 2023 · 3 comments
Open

Add support for CREATE TABLE PARTITION OF #825

hypnoglow opened this issue May 4, 2023 · 3 comments
Assignees

Comments

@hypnoglow
Copy link

According to docs, currently only PARTITION BY is supported but PARTITION OF is not.

i.e. for the provided example

CREATE TABLE measurements (
  id int8 PRIMARY KEY,
  value float8 NOT NULL,
  date timestamptz NOT NULL,
  hot boolean
) PARTITION BY LIST (hot);

CREATE TABLE measurements_hot PARTITION OF measurements
FOR VALUES IN (TRUE);

You can write bun query for the first statement:

_, err := db.NewCreateTable().
	Model((*Measure)(nil)).
	PartitionBy("LIST (hot)").
	Exec(ctx)

But you cannot write a query for the second statement in the same manner.

Although it is possible to use db.Exec(...) with plain SQL, we would be happy to see support for PARTITION OF in ORM CreateTable query.

@Jeongseup
Copy link

I totally agree with you

Copy link

github-actions bot commented Nov 8, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days. If there is no update within the next 7 days, this issue will be closed.

@github-actions github-actions bot added the stale label Nov 8, 2024
@hypnoglow
Copy link
Author

hypnoglow commented Nov 10, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days. If there is no update within the next 7 days, this issue will be closed.

Still relevant

@j2gg0s j2gg0s removed the stale label Nov 11, 2024
@j2gg0s j2gg0s self-assigned this Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants