-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://github.com/sqlc-dev/sqlc/issues/3371 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"contexts": ["managed-db"] | ||
} |
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,3 @@ | ||
-- name: GetAuthorMv :one | ||
SELECT * FROM authors_mv | ||
WHERE id = $1 LIMIT 1; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE authors ( | ||
id BIGSERIAL PRIMARY KEY, | ||
name text NOT NULL, | ||
bio text | ||
); | ||
|
||
CREATE MATERIALIZED VIEW authors_mv AS ( | ||
SELECT * FROM authors | ||
); | ||
|
||
CREATE MATERIALIZED VIEW authors_mv_new AS ( | ||
SELECT * FROM authors | ||
); | ||
|
||
ALTER MATERIALIZED VIEW authors_mv RENAME TO authors_mv_old; | ||
ALTER MATERIALIZED VIEW authors_mv_new RENAME TO authors_mv; | ||
|
||
DROP MATERIALIZED VIEW authors_mv_old; |
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/v4" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"contexts": ["managed-db"] | ||
} |
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,3 @@ | ||
-- name: GetAuthorMv :one | ||
SELECT * FROM authors_mv | ||
WHERE id = $1 LIMIT 1; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE authors ( | ||
id BIGSERIAL PRIMARY KEY, | ||
name text NOT NULL, | ||
bio text | ||
); | ||
|
||
CREATE MATERIALIZED VIEW authors_mv AS ( | ||
SELECT * FROM authors | ||
); | ||
|
||
CREATE MATERIALIZED VIEW authors_mv_new AS ( | ||
SELECT * FROM authors | ||
); | ||
|
||
ALTER MATERIALIZED VIEW authors_mv RENAME TO authors_mv_old; | ||
ALTER MATERIALIZED VIEW authors_mv_new RENAME TO authors_mv; | ||
|
||
DROP MATERIALIZED VIEW authors_mv_old; |
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" |