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 · 1 comment
Open

Add support for CREATE TABLE PARTITION OF #825

hypnoglow opened this issue May 4, 2023 · 1 comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants