Repository: sqlc-dev/sqlc
Pull request #3068 (2023-12-18 23:31:20)

build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/golang/crypto/commit/9d2ee975ef9fe627bf0a6f01c1f69e8ef1d4f05d"><code>9d2ee97</code></a> ssh: implement strict KEX protocol changes</li>
<li><a href="https://github.com/golang/crypto/commit/4e5a26183ecb4f9a0f85c8f8dbe7982885435436"><code>4e5a261</code></a> ssh: close net.Conn on all NewServerConn errors</li>
<li><a href="https://github.com/golang/crypto/commit/152cdb1503ebc13bc0fbb68f92ee189ebf9e3d00"><code>152cdb1</code></a> x509roots/fallback: update bundle</li>
<li><a href="https://github.com/golang/crypto/commit/fdfe1f8531a1adcc300c8eba98cb372044826d62"><code>fdfe1f8</code></a> ssh: defer channel window adjustment</li>
<li><a href="https://github.com/golang/crypto/commit/b8ffc16e10063067bac0e15c6d7f7995937503ce"><code>b8ffc16</code></a> blake2b: drop Go 1.6, Go 1.8 compatibility</li>
<li><a href="https://github.com/golang/crypto/commit/7e6fbd82c804e1760feb603fe21caecb0af0a124"><code>7e6fbd8</code></a> ssh: wrap errors from client handshake</li>
<li><a href="https://github.com/golang/crypto/commit/bda2f3f5cfce3f27039acccd823693f6d67c2a74"><code>bda2f3f</code></a> argon2: avoid clobbering BP</li>
<li><a href="https://github.com/golang/crypto/commit/325b735346247f48971d2b37d24dd180a35f391f"><code>325b735</code></a> ssh/test: skip TestSSHCLIAuth on Windows</li>
<li><a href="https://github.com/golang/crypto/commit/1eadac50a566dfaa1b603ca15e8ad3cbd1c77b20"><code>1eadac5</code></a> go.mod: update golang.org/x dependencies</li>
<li><a href="https://github.com/golang/crypto/commit/b2d7c26edb17864f117d8b0ee73c1843bcc6090f"><code>b2d7c26</code></a> ssh: add (*Client).DialContext method</li>
<li>Additional commits viewable in <a href="https://github.com/golang/crypto/compare/v0.14.0...v0.17.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/crypto&package-manager=go_modules&previous-version=0.14.0&new-version=0.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/sqlc-dev/sqlc/network/alerts).

</details>


Patch:
diff --git a/go.mod b/go.mod
index 62640248b..472626113 100644
--- a/go.mod
+++ b/go.mod
@@ -59,11 +59,11 @@ require (
 	go.uber.org/atomic v1.11.0 // indirect
 	go.uber.org/multierr v1.11.0 // indirect
 	go.uber.org/zap v1.26.0 // indirect
-	golang.org/x/crypto v0.14.0 // indirect
+	golang.org/x/crypto v0.17.0 // indirect
 	golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
 	golang.org/x/mod v0.13.0 // indirect
 	golang.org/x/net v0.17.0 // indirect
-	golang.org/x/sys v0.13.0 // indirect
+	golang.org/x/sys v0.15.0 // indirect
 	golang.org/x/text v0.14.0 // indirect
 	golang.org/x/tools v0.14.0 // indirect
 	google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect
diff --git a/go.sum b/go.sum
index c06c03d53..6f567fcba 100644
--- a/go.sum
+++ b/go.sum
@@ -233,8 +233,8 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y
 golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
-golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
-golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
+golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
+golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
 golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
 golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
 golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
@@ -272,8 +272,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
-golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
+golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
diff --git a/internal/compiler/analyze.go b/internal/compiler/analyze.go
index 82a67fb6f..38d66fce1 100644
--- a/internal/compiler/analyze.go
+++ b/internal/compiler/analyze.go
@@ -135,10 +135,6 @@ func (c *Compiler) _analyzeQuery(raw *ast.RawStmt, query string, failfast bool)
 
 	var table *ast.TableName
 	switch n := raw.Stmt.(type) {
-	case *ast.CallStmt:
-	case *ast.SelectStmt:
-	case *ast.DeleteStmt:
-	case *ast.DoStmt:
 	case *ast.InsertStmt:
 		if err := check(validate.InsertStmt(n)); err != nil {
 			return nil, err
@@ -148,15 +144,6 @@ func (c *Compiler) _analyzeQuery(raw *ast.RawStmt, query string, failfast bool)
 		if err := check(err); err != nil {
 			return nil, err
 		}
-	case *ast.ListenStmt:
-	case *ast.NotifyStmt:
-	case *ast.TruncateStmt:
-	case *ast.UpdateStmt:
-	case *ast.RefreshMatViewStmt:
-	default:
-		if err := check(ErrUnsupportedStatementType); err != nil {
-			return nil, err
-		}
 	}
 
 	if err := check(validate.FuncCall(c.catalog, c.combo, raw)); err != nil {
diff --git a/internal/compiler/compile.go b/internal/compiler/compile.go
index 19b737257..84fbb20a3 100644
--- a/internal/compiler/compile.go
+++ b/internal/compiler/compile.go
@@ -79,9 +79,6 @@ func (c *Compiler) parseQueries(o opts.Parser) (*Result, error) {
 		}
 		for _, stmt := range stmts {
 			query, err := c.parseQuery(stmt.Raw, src, o)
-			if err == ErrUnsupportedStatementType {
-				continue
-			}
 			if err != nil {
 				var e *sqlerr.Error
 				loc := stmt.Raw.Pos()
@@ -95,6 +92,10 @@ func (c *Compiler) parseQueries(o opts.Parser) (*Result, error) {
 				}
 				continue
 			}
+			if query == nil {
+				continue
+			}
+			query.Metadata.Filename = filepath.Base(filename)
 			queryName := query.Metadata.Name
 			if queryName != "" {
 				if _, exists := set[queryName]; exists {
@@ -103,10 +104,7 @@ func (c *Compiler) parseQueries(o opts.Parser) (*Result, error) {
 				}
 				set[queryName] = struct{}{}
 			}
-			query.Metadata.Filename = filepath.Base(filename)
-			if query != nil {
-				q = append(q, query)
-			}
+			q = append(q, query)
 		}
 	}
 	if len(merr.Errs()) > 0 {
diff --git a/internal/compiler/output_columns.go b/internal/compiler/output_columns.go
index 5b96a0856..dbdbe252b 100644
--- a/internal/compiler/output_columns.go
+++ b/internal/compiler/output_columns.go
@@ -57,7 +57,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er
 		return nil, err
 	}
 
-	var targets *ast.List
+	targets := &ast.List{}
 	switch n := node.(type) {
 	case *ast.DeleteStmt:
 		targets = n.ReturningList
@@ -114,16 +114,8 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er
 		if isUnion {
 			return c.outputColumns(qc, n.Larg)
 		}
-	case *ast.DoStmt:
-		targets = &ast.List{}
-	case *ast.CallStmt:
-		targets = &ast.List{}
-	case *ast.TruncateStmt, *ast.RefreshMatViewStmt, *ast.NotifyStmt, *ast.ListenStmt:
-		targets = &ast.List{}
 	case *ast.UpdateStmt:
 		targets = n.ReturningList
-	default:
-		return nil, fmt.Errorf("outputColumns: unsupported node type: %T", n)
 	}
 
 	var cols []*Column
@@ -487,7 +479,7 @@ func (r *tableVisitor) Visit(n ast.Node) astutils.Visitor {
 // Return an error if a table is referenced twice
 // Return an error if an unknown column is referenced
 func (c *Compiler) sourceTables(qc *QueryCatalog, node ast.Node) ([]*Table, error) {
-	var list *ast.List
+	list := &ast.List{}
 	switch n := node.(type) {
 	case *ast.DeleteStmt:
 		list = n.Relations
@@ -514,14 +506,6 @@ func (c *Compiler) sourceTables(qc *QueryCatalog, node ast.Node) ([]*Table, erro
 		astutils.Walk(&tv, n.FromClause)
 		astutils.Walk(&tv, n.Relations)
 		list = &tv.list
-	case *ast.DoStmt:
-		list = &ast.List{}
-	case *ast.CallStmt:
-		list = &ast.List{}
-	case *ast.NotifyStmt, *ast.ListenStmt:
-		list = &ast.List{}
-	default:
-		return nil, fmt.Errorf("sourceTables: unsupported node type: %T", n)
 	}
 
 	var tables []*Table
diff --git a/internal/compiler/parse.go b/internal/compiler/parse.go
index b47a72bee..8f4727144 100644
--- a/internal/compiler/parse.go
+++ b/internal/compiler/parse.go
@@ -15,8 +15,6 @@ import (
 	"github.com/sqlc-dev/sqlc/internal/sql/validate"
 )
 
-var ErrUnsupportedStatementType = errors.New("parseQuery: unsupported statement type")
-
 func (c *Compiler) parseQuery(stmt ast.Node, src string, o opts.Parser) (*Query, error) {
 	ctx := context.Background()
 


Test patch:
diff --git a/internal/endtoend/testdata/exec_create_table/mysql/db/db.go b/internal/endtoend/testdata/exec_create_table/mysql/db/db.go
new file mode 100644
index 000000000..e06d75a08
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/mysql/db/db.go
@@ -0,0 +1,31 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+//   sqlc v1.24.0
+
+package db
+
+import (
+	"context"
+	"database/sql"
+)
+
+type DBTX interface {
+	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
+	PrepareContext(context.Context, string) (*sql.Stmt, error)
+	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
+	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
+}
+
+func New(db DBTX) *Queries {
+	return &Queries{db: db}
+}
+
+type Queries struct {
+	db DBTX
+}
+
+func (q *Queries) WithTx(tx *sql.Tx) *Queries {
+	return &Queries{
+		db: tx,
+	}
+}
diff --git a/internal/endtoend/testdata/exec_create_table/mysql/db/models.go b/internal/endtoend/testdata/exec_create_table/mysql/db/models.go
new file mode 100644
index 000000000..477b93130
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/mysql/db/models.go
@@ -0,0 +1,7 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+//   sqlc v1.24.0
+
+package db
+
+import ()
diff --git a/internal/endtoend/testdata/exec_create_table/mysql/db/mysql.query.sql.go b/internal/endtoend/testdata/exec_create_table/mysql/db/mysql.query.sql.go
new file mode 100644
index 000000000..8dba113e5
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/mysql/db/mysql.query.sql.go
@@ -0,0 +1,19 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+//   sqlc v1.24.0
+// source: mysql.query.sql
+
+package db
+
+import (
+	"context"
+)
+
+const createTable = `-- name: CreateTable :exec
+CREATE TABLE test (id INTEGER NOT NULL)
+`
+
+func (q *Queries) CreateTable(ctx context.Context) error {
+	_, err := q.db.ExecContext(ctx, createTable)
+	return err
+}
diff --git a/internal/endtoend/testdata/exec_create_table/mysql/mysql.query.sql b/internal/endtoend/testdata/exec_create_table/mysql/mysql.query.sql
new file mode 100644
index 000000000..0a92ebb9c
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/mysql/mysql.query.sql
@@ -0,0 +1,2 @@
+-- name: CreateTable :exec
+CREATE TABLE test (id INTEGER NOT NULL);
diff --git a/internal/endtoend/testdata/exec_create_table/mysql/mysql.schema.sql b/internal/endtoend/testdata/exec_create_table/mysql/mysql.schema.sql
new file mode 100644
index 000000000..e69de29bb
diff --git a/internal/endtoend/testdata/exec_create_table/mysql/sqlc.yaml b/internal/endtoend/testdata/exec_create_table/mysql/sqlc.yaml
new file mode 100644
index 000000000..bd888aabf
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/mysql/sqlc.yaml
@@ -0,0 +1,8 @@
+version: 2
+sql:
+- queries: mysql.query.sql
+  schema: mysql.schema.sql
+  engine: mysql
+  gen:
+    go:
+      out: db
diff --git a/internal/endtoend/testdata/exec_create_table/postgresql/db/db.go b/internal/endtoend/testdata/exec_create_table/postgresql/db/db.go
new file mode 100644
index 000000000..e06d75a08
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/postgresql/db/db.go
@@ -0,0 +1,31 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+//   sqlc v1.24.0
+
+package db
+
+import (
+	"context"
+	"database/sql"
+)
+
+type DBTX interface {
+	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
+	PrepareContext(context.Context, string) (*sql.Stmt, error)
+	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
+	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
+}
+
+func New(db DBTX) *Queries {
+	return &Queries{db: db}
+}
+
+type Queries struct {
+	db DBTX
+}
+
+func (q *Queries) WithTx(tx *sql.Tx) *Queries {
+	return &Queries{
+		db: tx,
+	}
+}
diff --git a/internal/endtoend/testdata/exec_create_table/postgresql/db/models.go b/internal/endtoend/testdata/exec_create_table/postgresql/db/models.go
new file mode 100644
index 000000000..477b93130
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/postgresql/db/models.go
@@ -0,0 +1,7 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+//   sqlc v1.24.0
+
+package db
+
+import ()
diff --git a/internal/endtoend/testdata/exec_create_table/postgresql/db/postgresql.query.sql.go b/internal/endtoend/testdata/exec_create_table/postgresql/db/postgresql.query.sql.go
new file mode 100644
index 000000000..24e23cefe
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/postgresql/db/postgresql.query.sql.go
@@ -0,0 +1,19 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+//   sqlc v1.24.0
+// source: postgresql.query.sql
+
+package db
+
+import (
+	"context"
+)
+
+const createTable = `-- name: CreateTable :exec
+CREATE TABLE test (id INTEGER NOT NULL)
+`
+
+func (q *Queries) CreateTable(ctx context.Context) error {
+	_, err := q.db.ExecContext(ctx, createTable)
+	return err
+}
diff --git a/internal/endtoend/testdata/exec_create_table/postgresql/postgresql.query.sql b/internal/endtoend/testdata/exec_create_table/postgresql/postgresql.query.sql
new file mode 100644
index 000000000..0a92ebb9c
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/postgresql/postgresql.query.sql
@@ -0,0 +1,2 @@
+-- name: CreateTable :exec
+CREATE TABLE test (id INTEGER NOT NULL);
diff --git a/internal/endtoend/testdata/exec_create_table/postgresql/postgresql.schema.sql b/internal/endtoend/testdata/exec_create_table/postgresql/postgresql.schema.sql
new file mode 100644
index 000000000..e69de29bb
diff --git a/internal/endtoend/testdata/exec_create_table/postgresql/sqlc.yaml b/internal/endtoend/testdata/exec_create_table/postgresql/sqlc.yaml
new file mode 100644
index 000000000..6a89eb217
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/postgresql/sqlc.yaml
@@ -0,0 +1,9 @@
+version: 2
+sql:
+- queries: postgresql.query.sql
+  schema: postgresql.schema.sql
+  engine: postgresql
+  gen:
+    go:
+      out: db
+
diff --git a/internal/endtoend/testdata/exec_create_table/sqlite/db/db.go b/internal/endtoend/testdata/exec_create_table/sqlite/db/db.go
new file mode 100644
index 000000000..e06d75a08
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/sqlite/db/db.go
@@ -0,0 +1,31 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+//   sqlc v1.24.0
+
+package db
+
+import (
+	"context"
+	"database/sql"
+)
+
+type DBTX interface {
+	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
+	PrepareContext(context.Context, string) (*sql.Stmt, error)
+	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
+	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
+}
+
+func New(db DBTX) *Queries {
+	return &Queries{db: db}
+}
+
+type Queries struct {
+	db DBTX
+}
+
+func (q *Queries) WithTx(tx *sql.Tx) *Queries {
+	return &Queries{
+		db: tx,
+	}
+}
diff --git a/internal/endtoend/testdata/exec_create_table/sqlite/db/models.go b/internal/endtoend/testdata/exec_create_table/sqlite/db/models.go
new file mode 100644
index 000000000..477b93130
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/sqlite/db/models.go
@@ -0,0 +1,7 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+//   sqlc v1.24.0
+
+package db
+
+import ()
diff --git a/internal/endtoend/testdata/exec_create_table/sqlite/db/sqlite.query.sql.go b/internal/endtoend/testdata/exec_create_table/sqlite/db/sqlite.query.sql.go
new file mode 100644
index 000000000..ea8fcafec
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/sqlite/db/sqlite.query.sql.go
@@ -0,0 +1,19 @@
+// Code generated by sqlc. DO NOT EDIT.
+// versions:
+//   sqlc v1.24.0
+// source: sqlite.query.sql
+
+package db
+
+import (
+	"context"
+)
+
+const createTable = `-- name: CreateTable :exec
+CREATE TABLE test (id INTEGER NOT NULL)
+`
+
+func (q *Queries) CreateTable(ctx context.Context) error {
+	_, err := q.db.ExecContext(ctx, createTable)
+	return err
+}
diff --git a/internal/endtoend/testdata/exec_create_table/sqlite/sqlc.yaml b/internal/endtoend/testdata/exec_create_table/sqlite/sqlc.yaml
new file mode 100644
index 000000000..bf2e6024b
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/sqlite/sqlc.yaml
@@ -0,0 +1,8 @@
+version: 2
+sql:
+- queries: sqlite.query.sql
+  schema: sqlite.schema.sql
+  engine: sqlite
+  gen:
+    go:
+      out: db
diff --git a/internal/endtoend/testdata/exec_create_table/sqlite/sqlite.query.sql b/internal/endtoend/testdata/exec_create_table/sqlite/sqlite.query.sql
new file mode 100644
index 000000000..0a92ebb9c
--- /dev/null
+++ b/internal/endtoend/testdata/exec_create_table/sqlite/sqlite.query.sql
@@ -0,0 +1,2 @@
+-- name: CreateTable :exec
+CREATE TABLE test (id INTEGER NOT NULL);
diff --git a/internal/endtoend/testdata/exec_create_table/sqlite/sqlite.schema.sql b/internal/endtoend/testdata/exec_create_table/sqlite/sqlite.schema.sql
new file mode 100644
index 000000000..e69de29bb
diff --git a/internal/endtoend/testdata/vet_failures/query.sql b/internal/endtoend/testdata/vet_failures/query.sql
index 718f3395c..75e38b2ca 100644
--- a/internal/endtoend/testdata/vet_failures/query.sql
+++ b/internal/endtoend/testdata/vet_failures/query.sql
@@ -1,9 +1,3 @@
-CREATE TABLE authors (
-          id   BIGSERIAL PRIMARY KEY,
-          name text      NOT NULL,
-          bio  text
-);
-
 -- name: GetAuthor :one
 SELECT * FROM authors
 WHERE id = $1 LIMIT 1;
diff --git a/internal/endtoend/testdata/vet_failures/sqlc.yaml b/internal/endtoend/testdata/vet_failures/sqlc.yaml
index 10d5246f8..b1cff78c3 100644
--- a/internal/endtoend/testdata/vet_failures/sqlc.yaml
+++ b/internal/endtoend/testdata/vet_failures/sqlc.yaml
@@ -1,6 +1,6 @@
 version: 2
 sql:
-  - schema: "query.sql"
+  - schema: "schema.sql"
     queries: "query.sql"
     engine: "postgresql"
     gen: