drizzle-kit 0.15.0 → 0.15.1
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/index.js +25 -24
- package/package.json +1 -1
- package/readme.md +9 -0
package/index.js
CHANGED
|
@@ -20571,6 +20571,29 @@ var init_migrate = __esm({
|
|
|
20571
20571
|
}
|
|
20572
20572
|
});
|
|
20573
20573
|
|
|
20574
|
+
// src/@types/utils.ts
|
|
20575
|
+
var init_utils = __esm({
|
|
20576
|
+
"src/@types/utils.ts"() {
|
|
20577
|
+
String.prototype.trimChar = function(char) {
|
|
20578
|
+
let start = 0;
|
|
20579
|
+
let end = this.length;
|
|
20580
|
+
while (start < end && this[start] === char)
|
|
20581
|
+
++start;
|
|
20582
|
+
while (end > start && this[end - 1] === char)
|
|
20583
|
+
--end;
|
|
20584
|
+
return start > 0 || end < this.length ? this.substring(start, end) : this.toString();
|
|
20585
|
+
};
|
|
20586
|
+
String.prototype.squashSpaces = function() {
|
|
20587
|
+
return this.replace(/ +/g, " ").trim();
|
|
20588
|
+
};
|
|
20589
|
+
String.prototype.camelCase = function() {
|
|
20590
|
+
return this.toLowerCase().replace(/([-_ ][a-z0-9])/g, (group) => {
|
|
20591
|
+
return group.toUpperCase().replace("-", "").replace("_", "").replace(" ", "");
|
|
20592
|
+
});
|
|
20593
|
+
};
|
|
20594
|
+
}
|
|
20595
|
+
});
|
|
20596
|
+
|
|
20574
20597
|
// node_modules/.pnpm/postgres-array@2.0.0/node_modules/postgres-array/index.js
|
|
20575
20598
|
var require_postgres_array = __commonJS({
|
|
20576
20599
|
"node_modules/.pnpm/postgres-array@2.0.0/node_modules/postgres-array/index.js"(exports) {
|
|
@@ -25002,29 +25025,6 @@ var require_lib3 = __commonJS({
|
|
|
25002
25025
|
}
|
|
25003
25026
|
});
|
|
25004
25027
|
|
|
25005
|
-
// src/@types/utils.ts
|
|
25006
|
-
var init_utils = __esm({
|
|
25007
|
-
"src/@types/utils.ts"() {
|
|
25008
|
-
String.prototype.trimChar = function(char) {
|
|
25009
|
-
let start = 0;
|
|
25010
|
-
let end = this.length;
|
|
25011
|
-
while (start < end && this[start] === char)
|
|
25012
|
-
++start;
|
|
25013
|
-
while (end > start && this[end - 1] === char)
|
|
25014
|
-
--end;
|
|
25015
|
-
return start > 0 || end < this.length ? this.substring(start, end) : this.toString();
|
|
25016
|
-
};
|
|
25017
|
-
String.prototype.squashSpaces = function() {
|
|
25018
|
-
return this.replace(/ +/g, " ").trim();
|
|
25019
|
-
};
|
|
25020
|
-
String.prototype.camelCase = function() {
|
|
25021
|
-
return this.toLowerCase().replace(/([-_ ][a-z0-9])/g, (group) => {
|
|
25022
|
-
return group.toUpperCase().replace("-", "").replace("_", "").replace(" ", "");
|
|
25023
|
-
});
|
|
25024
|
-
};
|
|
25025
|
-
}
|
|
25026
|
-
});
|
|
25027
|
-
|
|
25028
25028
|
// src/introspect.ts
|
|
25029
25029
|
var pgImportsList, objToStatement, objToStatement2, timeConfig, importsPatch, relations, schemaToTypeScript, isCyclic, isSelf, column4, createTableColumns, createTableIndexes, createTableFKs;
|
|
25030
25030
|
var init_introspect = __esm({
|
|
@@ -25681,7 +25681,7 @@ init_source();
|
|
|
25681
25681
|
// package.json
|
|
25682
25682
|
var package_default = {
|
|
25683
25683
|
name: "drizzle-kit",
|
|
25684
|
-
version: "0.15.
|
|
25684
|
+
version: "0.15.1",
|
|
25685
25685
|
repository: "https://github.com/drizzle-team/drizzle-kit-mirror",
|
|
25686
25686
|
author: "Alex Blokh <aleksandrblokh@gmail.com>",
|
|
25687
25687
|
license: "MIT",
|
|
@@ -25755,6 +25755,7 @@ var package_default = {
|
|
|
25755
25755
|
// src/cli/index.ts
|
|
25756
25756
|
init_migrate();
|
|
25757
25757
|
init_snapshotsDiffer();
|
|
25758
|
+
init_utils();
|
|
25758
25759
|
var printVersions = () => {
|
|
25759
25760
|
console.log(`${source_default.gray(versions())}
|
|
25760
25761
|
`);
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -86,6 +86,15 @@ $ drizzle-kit generate --dialect pg --schema src/schema.ts
|
|
|
86
86
|
$ drizzle-kit generate --dialect .. --schema .. --out ./migration-folder
|
|
87
87
|
## runs generate command and outputs results to ./migration-folder
|
|
88
88
|
```
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
**`$ drizzle-kit introspect:pg`** - generate `schema.ts` file from existing PG database within seconds
|
|
92
|
+
```shell
|
|
93
|
+
drizzle-kit introspect:pg --out=migrations/ --connectionString=postgresql://user:pass@host:port/db_name
|
|
94
|
+
|
|
95
|
+
drizzle-kit introspect:pg --out=migrations/ --host=0.0.0.0 --port=5432 --user=postgres --password=pass --database=db_name --ssl
|
|
96
|
+
```
|
|
97
|
+
|
|
89
98
|
**`$ drizzle-kit up`** - updates stale snapshots
|
|
90
99
|
`--config` [optional defalut=drizzle.config.json] path to an optional config file\
|
|
91
100
|
`--dialect` [optional default=pg] database dialect, one of -> pg, mysql, sqlite\
|