velocious 1.0.758 → 1.0.759
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/build/database/advisory-lock-lock-server-backend.js +10 -0
- package/build/database/advisory-lock-runner.js +46 -17
- package/build/database/drivers/base-table.js +13 -0
- package/build/database/drivers/mssql/table.js +18 -8
- package/build/database/drivers/mysql/table.js +14 -4
- package/build/database/drivers/pgsql/table.js +18 -8
- package/build/database/drivers/sqlite/table.js +16 -6
- package/build/src/database/advisory-lock-lock-server-backend.d.ts +7 -0
- package/build/src/database/advisory-lock-lock-server-backend.d.ts.map +1 -1
- package/build/src/database/advisory-lock-lock-server-backend.js +10 -1
- package/build/src/database/advisory-lock-runner.d.ts +3 -0
- package/build/src/database/advisory-lock-runner.d.ts.map +1 -1
- package/build/src/database/advisory-lock-runner.js +43 -18
- package/build/src/database/drivers/base-table.d.ts +8 -0
- package/build/src/database/drivers/base-table.d.ts.map +1 -1
- package/build/src/database/drivers/base-table.js +12 -1
- package/build/src/database/drivers/mssql/table.d.ts +7 -2
- package/build/src/database/drivers/mssql/table.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/table.js +15 -7
- package/build/src/database/drivers/mysql/table.d.ts +7 -2
- package/build/src/database/drivers/mysql/table.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/table.js +13 -5
- package/build/src/database/drivers/pgsql/table.d.ts +7 -2
- package/build/src/database/drivers/pgsql/table.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/table.js +15 -7
- package/build/src/database/drivers/sqlite/table.d.ts +6 -0
- package/build/src/database/drivers/sqlite/table.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/table.js +15 -7
- package/package.json +1 -1
- package/src/database/advisory-lock-lock-server-backend.js +10 -0
- package/src/database/advisory-lock-runner.js +46 -17
- package/src/database/drivers/base-table.js +13 -0
- package/src/database/drivers/mssql/table.js +18 -8
- package/src/database/drivers/mysql/table.js +14 -4
- package/src/database/drivers/pgsql/table.js +18 -8
- package/src/database/drivers/sqlite/table.js +16 -6
|
@@ -63,6 +63,23 @@ export default class VelociousDatabaseDriversMssqlTable extends BaseTable {
|
|
|
63
63
|
this.driver = driver
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Builds this table's column objects from raw `INFORMATION_SCHEMA.COLUMNS`-shaped rows.
|
|
68
|
+
* @param {import("../base.js").QueryResultType} columnRows - Raw column rows for this table.
|
|
69
|
+
* @returns {Array<import("../base-column.js").default>} - Columns built from the rows.
|
|
70
|
+
*/
|
|
71
|
+
columnsFromRows(columnRows) {
|
|
72
|
+
const columns = []
|
|
73
|
+
|
|
74
|
+
for (const data of columnRows) {
|
|
75
|
+
const column = new Column(this, data)
|
|
76
|
+
|
|
77
|
+
columns.push(column)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return columns
|
|
81
|
+
}
|
|
82
|
+
|
|
66
83
|
async getColumns() {
|
|
67
84
|
const columnRows = await this.getDriver()._cachedTableSchemaMetadata(this.getName(), "columns", async () => {
|
|
68
85
|
const result = await this.driver.query(`
|
|
@@ -88,15 +105,8 @@ export default class VelociousDatabaseDriversMssqlTable extends BaseTable {
|
|
|
88
105
|
`)
|
|
89
106
|
return result
|
|
90
107
|
})
|
|
91
|
-
const columns = []
|
|
92
|
-
|
|
93
|
-
for (const data of columnRows) {
|
|
94
|
-
const column = new Column(this, data)
|
|
95
108
|
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return columns
|
|
109
|
+
return this.columnsFromRows(columnRows)
|
|
100
110
|
}
|
|
101
111
|
|
|
102
112
|
async getForeignKeys() {
|
|
@@ -17,10 +17,12 @@ export default class VelociousDatabaseDriversMysqlTable extends BaseTable {
|
|
|
17
17
|
this.driver = driver
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Builds this table's column objects from raw `SHOW FULL COLUMNS`-shaped rows.
|
|
22
|
+
* @param {import("../base.js").QueryResultType} columnRows - Raw column rows for this table.
|
|
23
|
+
* @returns {Array<import("../base-column.js").default>} - Columns built from the rows.
|
|
24
|
+
*/
|
|
25
|
+
columnsFromRows(columnRows) {
|
|
24
26
|
const columns = []
|
|
25
27
|
|
|
26
28
|
for (const data of columnRows) {
|
|
@@ -32,6 +34,14 @@ export default class VelociousDatabaseDriversMysqlTable extends BaseTable {
|
|
|
32
34
|
return columns
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
async getColumns() {
|
|
38
|
+
const columnRows = await this.getDriver()._cachedTableSchemaMetadata(this.getName(), "columns", async () => {
|
|
39
|
+
return await this.driver.query(`SHOW FULL COLUMNS FROM \`${this.getName()}\``)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
return this.columnsFromRows(columnRows)
|
|
43
|
+
}
|
|
44
|
+
|
|
35
45
|
async getForeignKeys() {
|
|
36
46
|
const foreignKeyRows = await this.getDriver()._cachedTableSchemaMetadata(this.getName(), "foreignKeys", async () => {
|
|
37
47
|
const sql = `
|
|
@@ -62,6 +62,23 @@ export default class VelociousDatabaseDriversPgsqlTable extends BaseTable {
|
|
|
62
62
|
this.driver = driver
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Builds this table's column objects from raw `information_schema.columns`-shaped rows.
|
|
67
|
+
* @param {import("../base.js").QueryResultType} columnRows - Raw column rows for this table.
|
|
68
|
+
* @returns {Array<import("../base-column.js").default>} - Columns built from the rows.
|
|
69
|
+
*/
|
|
70
|
+
columnsFromRows(columnRows) {
|
|
71
|
+
const columns = []
|
|
72
|
+
|
|
73
|
+
for (const data of columnRows) {
|
|
74
|
+
const column = new Column(this, data)
|
|
75
|
+
|
|
76
|
+
columns.push(column)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return columns
|
|
80
|
+
}
|
|
81
|
+
|
|
65
82
|
async getColumns() {
|
|
66
83
|
const columnRows = await this.getDriver()._cachedTableSchemaMetadata(this.getName(), "columns", async () => {
|
|
67
84
|
const result = await this.driver.query(`
|
|
@@ -91,15 +108,8 @@ export default class VelociousDatabaseDriversPgsqlTable extends BaseTable {
|
|
|
91
108
|
`)
|
|
92
109
|
return result
|
|
93
110
|
})
|
|
94
|
-
const columns = []
|
|
95
|
-
|
|
96
|
-
for (const data of columnRows) {
|
|
97
|
-
const column = new Column(this, data)
|
|
98
111
|
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return columns
|
|
112
|
+
return this.columnsFromRows(columnRows)
|
|
103
113
|
}
|
|
104
114
|
|
|
105
115
|
async getForeignKeys() {
|
|
@@ -19,13 +19,11 @@ export default class VelociousDatabaseDriversSqliteTable extends BaseTable {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
22
|
+
* Builds this table's column objects from raw `PRAGMA table_info` rows.
|
|
23
|
+
* @param {import("../base.js").QueryResultType} columnRows - Raw column rows for this table.
|
|
24
|
+
* @returns {Array<import("../base-column.js").default>} - Columns built from the rows.
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
-
const columnRows = await this.getDriver()._cachedTableSchemaMetadata(this.getName(), "columns", async () => {
|
|
27
|
-
return await this.driver.query(`PRAGMA table_info('${this.getName()}')`)
|
|
28
|
-
})
|
|
26
|
+
columnsFromRows(columnRows) {
|
|
29
27
|
const columns = []
|
|
30
28
|
|
|
31
29
|
for (const columnData of columnRows) {
|
|
@@ -37,6 +35,18 @@ export default class VelociousDatabaseDriversSqliteTable extends BaseTable {
|
|
|
37
35
|
return columns
|
|
38
36
|
}
|
|
39
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Runs get columns.
|
|
40
|
+
* @returns {Promise<Array<import("../base-column.js").default>>} - Resolves with the columns.
|
|
41
|
+
*/
|
|
42
|
+
async getColumns() {
|
|
43
|
+
const columnRows = await this.getDriver()._cachedTableSchemaMetadata(this.getName(), "columns", async () => {
|
|
44
|
+
return await this.driver.query(`PRAGMA table_info('${this.getName()}')`)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
return this.columnsFromRows(columnRows)
|
|
48
|
+
}
|
|
49
|
+
|
|
40
50
|
async getForeignKeys() {
|
|
41
51
|
const foreignKeysData = await this.getDriver()._cachedTableSchemaMetadata(this.getName(), "foreignKeys", async () => {
|
|
42
52
|
return await this.driver.query(`SELECT * FROM pragma_foreign_key_list(${this.driver.quote(this.getName())})`)
|