@tursodatabase/database 0.7.1 → 0.7.2-pre.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compat.test.js +6 -4
- package/dist/promise.test.js +5 -3
- package/package.json +6 -6
package/dist/compat.test.js
CHANGED
|
@@ -43,16 +43,18 @@ test('exec multiple statements', async () => {
|
|
|
43
43
|
const rows = stmt.all();
|
|
44
44
|
expect(rows).toEqual([{ x: 1 }, { x: 2 }]);
|
|
45
45
|
});
|
|
46
|
-
test('expanded rows
|
|
46
|
+
test('expanded rows collapse duplicate column names like better-sqlite3', () => {
|
|
47
47
|
const db = new Database(":memory:");
|
|
48
48
|
db.exec("CREATE TABLE role(path TEXT); CREATE TABLE org_unit(path TEXT)");
|
|
49
49
|
db.exec("INSERT INTO role VALUES ('/Employee'); INSERT INTO org_unit VALUES ('/')");
|
|
50
|
-
const
|
|
50
|
+
const stmt = db.prepare("SELECT role.path, org_unit.path FROM role JOIN org_unit");
|
|
51
|
+
const row = stmt.get();
|
|
51
52
|
expect(Object.keys(row)).toEqual(["path"]);
|
|
52
53
|
expect(row.path).toBe("/");
|
|
53
|
-
expect(row[0]).toBe(
|
|
54
|
-
expect(row[1]).toBe(
|
|
54
|
+
expect(row[0]).toBe(undefined);
|
|
55
|
+
expect(row[1]).toBe(undefined);
|
|
55
56
|
expect(row).toEqual({ path: "/" });
|
|
57
|
+
expect(stmt.raw(true).get()).toEqual(["/Employee", "/"]);
|
|
56
58
|
});
|
|
57
59
|
test('readonly-db', () => {
|
|
58
60
|
const path = `test-${(Math.random() * 10000) | 0}.db`;
|
package/dist/promise.test.js
CHANGED
|
@@ -36,16 +36,18 @@ test('exec multiple statements', async () => {
|
|
|
36
36
|
const rows = await stmt.all();
|
|
37
37
|
expect(rows).toEqual([{ x: 1 }, { x: 2 }]);
|
|
38
38
|
});
|
|
39
|
-
test('expanded rows
|
|
39
|
+
test('expanded rows collapse duplicate column names like better-sqlite3', async () => {
|
|
40
40
|
const db = await connect(":memory:");
|
|
41
41
|
await db.exec("CREATE TABLE role(path TEXT); CREATE TABLE org_unit(path TEXT)");
|
|
42
42
|
await db.exec("INSERT INTO role VALUES ('/Employee'); INSERT INTO org_unit VALUES ('/')");
|
|
43
43
|
const [row] = await db.all("SELECT role.path, org_unit.path FROM role JOIN org_unit");
|
|
44
44
|
expect(Object.keys(row)).toEqual(["path"]);
|
|
45
45
|
expect(row.path).toBe("/");
|
|
46
|
-
expect(row[0]).toBe(
|
|
47
|
-
expect(row[1]).toBe(
|
|
46
|
+
expect(row[0]).toBe(undefined);
|
|
47
|
+
expect(row[1]).toBe(undefined);
|
|
48
48
|
expect(row).toEqual({ path: "/" });
|
|
49
|
+
const stmt = await db.prepare("SELECT role.path, org_unit.path FROM role JOIN org_unit");
|
|
50
|
+
expect(await stmt.raw(true).get()).toEqual(["/Employee", "/"]);
|
|
49
51
|
});
|
|
50
52
|
test('readonly-db', async () => {
|
|
51
53
|
const path = `test-${(Math.random() * 10000) | 0}.db`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tursodatabase/database",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2-pre.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/tursodatabase/turso"
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
]
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@tursodatabase/database-common": "^0.7.
|
|
52
|
+
"@tursodatabase/database-common": "^0.7.2-pre.2"
|
|
53
53
|
},
|
|
54
54
|
"imports": {
|
|
55
55
|
"#index": "./index.js"
|
|
56
56
|
},
|
|
57
57
|
"optionalDependencies": {
|
|
58
|
-
"@tursodatabase/database-linux-x64-gnu": "0.7.
|
|
59
|
-
"@tursodatabase/database-win32-x64-msvc": "0.7.
|
|
60
|
-
"@tursodatabase/database-darwin-arm64": "0.7.
|
|
61
|
-
"@tursodatabase/database-linux-arm64-gnu": "0.7.
|
|
58
|
+
"@tursodatabase/database-linux-x64-gnu": "0.7.2-pre.2",
|
|
59
|
+
"@tursodatabase/database-win32-x64-msvc": "0.7.2-pre.2",
|
|
60
|
+
"@tursodatabase/database-darwin-arm64": "0.7.2-pre.2",
|
|
61
|
+
"@tursodatabase/database-linux-arm64-gnu": "0.7.2-pre.2"
|
|
62
62
|
}
|
|
63
63
|
}
|