drizzle-kit 0.16.0 → 0.16.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.
Files changed (3) hide show
  1. package/index.js +2078 -1287
  2. package/package.json +4 -4
  3. package/readme.md +43 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.16.0",
3
+ "version": "0.16.2",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Alex Blokh <aleksandrblokh@gmail.com>",
6
6
  "license": "MIT",
@@ -35,9 +35,9 @@
35
35
  "@typescript-eslint/parser": "^5.46.1",
36
36
  "ava": "^5.1.0",
37
37
  "dockerode": "^3.3.4",
38
- "drizzle-orm": "0.15.0-60954a3",
39
- "drizzle-orm-mysql": "0.15.0-60954a3",
40
- "drizzle-orm-pg": "0.15.0-60954a3",
38
+ "drizzle-orm": "0.15.1-a1b76f5",
39
+ "drizzle-orm-mysql": "0.15.1-a1b76f5",
40
+ "drizzle-orm-pg": "0.15.1-a1b76f5",
41
41
  "drizzle-orm-sqlite": "0.15.0-60954a3",
42
42
  "esbuild": "^0.15.7",
43
43
  "esbuild-register": "^3.3.3",
package/readme.md CHANGED
@@ -61,49 +61,70 @@ $ npm exec drizzle-kit generate --out migrations-folder --dialect pg --schema sr
61
61
  Or put your file to `drizzle.config.json` configuration file:
62
62
  ```json
63
63
  {
64
- "dialect": "pg",
65
64
  "out": "./migrations-folder",
66
65
  "schema": "./src/db"
67
66
  }
68
67
  ```
69
68
  ---
70
- ### List of commands
71
- **`$ drizzle-kit generate`** - generates SQL migrations based on .ts schema\
72
- `--config` [optional defalut=drizzle.config.json] path to an optional config file\
73
- `--dialect` [optional default=pg] database dialect, one of -> pg, mysql, sqlite\
74
- `--schema` path to a schema file or folder with multiple schema files\
75
- `--out` [optional default=drizzle/] place where to store migration files\
69
+ ## List of commands
70
+
71
+ ### Generate SQL migrations based on current .ts schema\
72
+ **`$ drizzle-kit generate:pg`** \
73
+ **`$ drizzle-kit generate:mysql`** \
74
+ **`$ drizzle-kit generate:sqlite`** \
75
+
76
+ `--config` [optional defalut=drizzle.config.json] config file path\
77
+ `--schema` path to typescript schema file or folder with multiple schema files\
78
+ `--out` [optional default=drizzle/] migrations folder
76
79
  ```shell
77
- $ drizzle-kit generate
80
+ $ drizzle-kit generate:pg
78
81
  ## runs generate command with drizzle.config.json
79
82
 
80
- $ drizzle-kit generate --config custom.config.json
83
+ $ drizzle-kit generate:pg --config=./custom.config.json
81
84
  ## runs generate command with custom.config.json
82
85
 
83
- $ drizzle-kit generate --dialect pg --schema src/schema.ts
86
+ $ drizzle-kit generate:pg --schema=./src/schema.ts
84
87
  ## runs generate command and outputs results to ./drizzle
85
88
 
86
- $ drizzle-kit generate --dialect .. --schema .. --out ./migration-folder
87
- ## runs generate command and outputs results to ./migration-folder
89
+ $ drizzle-kit generate:pg --schema=./src/schema.ts --out=./migrations/
90
+ ## runs generate command and outputs results to ./migration
88
91
  ```
89
92
 
90
-
91
- **`$ drizzle-kit introspect:pg`** - generate `schema.ts` file from existing PG database within seconds
93
+ ### Introspect existing database and generate typescript schema
94
+ **`$ drizzle-kit introspect:pg`**
92
95
  ```shell
93
96
  drizzle-kit introspect:pg --out=migrations/ --connectionString=postgresql://user:pass@host:port/db_name
94
97
 
95
98
  drizzle-kit introspect:pg --out=migrations/ --host=0.0.0.0 --port=5432 --user=postgres --password=pass --database=db_name --ssl
96
99
  ```
97
100
 
98
- **`$ drizzle-kit up`** - updates stale snapshots
99
- `--config` [optional defalut=drizzle.config.json] path to an optional config file\
100
- `--dialect` [optional default=pg] database dialect, one of -> pg, mysql, sqlite\
101
- `--schema` path to a schema file or folder with multiple schema files\
101
+ ### Update stale snapshots
102
+ **`$ drizzle-kit up:pg`** \
103
+ **`$ drizzle-kit up:mysql`**\
104
+ **`$ drizzle-kit up:sqlite`**
102
105
 
103
- **`$ drizzle-kit check`** - checks for collisions
104
- `--config` [optional defalut=drizzle.config.json] path to an optional config file\
105
- `--dialect` [optional default=pg] database dialect, one of -> pg, mysql, sqlite\
106
- `--schema` path to a schema file or folder with multiple schema files\
106
+ `--out` [optional] migrations folder\
107
+ `--config` [optional defalut=drizzle.config.json] config file path
108
+ ```shell
109
+ ## migrations folder is taken from drizzle.config.json
110
+ drizzle-kit up:pg
111
+
112
+ drizzle-kit up:pg --out=migrations/
113
+ ```
114
+
115
+ ### Migrations collisions check
116
+ **`$ drizzle-kit check:pg`**\
117
+ **`$ drizzle-kit check:mysql`**\
118
+ **`$ drizzle-kit check:sqlite`**
119
+
120
+ `--out` [optional] migration folder\
121
+ `--config` [optional defalut=drizzle.config.json] config file path
122
+ ```shell
123
+ ## migrations folder is taken from drizzle.config.json
124
+ drizzle-kit check:pg
125
+
126
+ drizzle-kit check:pg --out=migrations/
127
+ ```
107
128
 
108
129
 
109
130