Skip to content

Commit fe96e12

Browse files
bugfix: Normalize identifier usage for table names (#4045)
* fix normalize identifier for table names * add tests for case sensitive table operations
1 parent 0201d70 commit fe96e12

File tree

20 files changed

+549
-6
lines changed

20 files changed

+549
-6
lines changed

internal/endtoend/testdata/ddl_alter_table_case_sensitivity/sqlite/go/db.go

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/ddl_alter_table_case_sensitivity/sqlite/go/models.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/ddl_alter_table_case_sensitivity/sqlite/go/query.sql.go

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- name: InsertUser :exec
2+
INSERT INTO Users (full_name, "EmailAddress", created_at)
3+
VALUES (?, ?, ?);
4+
5+
-- name: SelectUsers :many
6+
SELECT id, full_name, "EmailAddress", created_at
7+
FROM Users;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Test ALTER TABLE operations with mixed case table and column names
2+
-- Verifies consistent handling of case sensitivity in DDL operations
3+
CREATE TABLE Users (id integer primary key, name text, "Email" text);
4+
5+
-- Test renaming columns with different case formats
6+
ALTER TABLE Users RENAME COLUMN name TO full_name;
7+
ALTER TABLE Users RENAME COLUMN "Email" TO "EmailAddress";
8+
9+
-- Test adding a simple column
10+
ALTER TABLE Users ADD COLUMN created_at text;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "1",
3+
"packages": [
4+
{
5+
"path": "go",
6+
"engine": "sqlite",
7+
"name": "querytest",
8+
"schema": "schema.sql",
9+
"queries": "query.sql"
10+
}
11+
]
12+
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
CREATE TABLE venues (hi text);
2-
DROP TABLE venues;
2+
DROP TABLE venues;
3+
4+
CREATE TABLE Authors (id integer);
5+
DROP TABLE Authors;
6+
7+
CREATE TABLE "Books" (id integer);
8+
DROP TABLE "Books";

internal/endtoend/testdata/quoted_names_complex/sqlite/go/db.go

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/quoted_names_complex/sqlite/go/models.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/quoted_names_complex/sqlite/go/query.sql.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)