Skip to content

Support PostgreSQL CREATE TABLE LIKE #2924

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

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: Add test case for CREATE TABLE LIKE
  • Loading branch information
kyleconroy committed Oct 31, 2023
commit e1b200a1f66fe65e10e5a55b5cfe70a980bc547d
1 change: 1 addition & 0 deletions internal/endtoend/testdata/ddl_create_table_like/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/sqlc-dev/sqlc/issues/481

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- name: AllRanked :many
SELECT * FROM changes_ranked;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE changes (
ranked INT NOT NULL
);

CREATE TABLE changes_ranked (
LIKE changes INCLUDING ALL,
rank_by_effect_size INT NOT NULL,
rank_by_abs_percent_change INT NOT NULL
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "2"
sql:
- engine: "postgresql"
schema: "schema.sql"
queries: "query.sql"
gen:
go:
package: "querytest"
out: "go"
sql_package: "pgx/v5"