pgpm 0.2.4 → 0.2.6

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 (2) hide show
  1. package/README.md +32 -92
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -30,7 +30,7 @@ eval "$(pgpm env)"
30
30
 
31
31
  ---
32
32
 
33
- ### Create Your First Project
33
+ ### Create a Workspace and Install a Package
34
34
 
35
35
  ```bash
36
36
  # 1. Create a workspace
@@ -39,12 +39,15 @@ cd my-app
39
39
 
40
40
  # 2. Create your first module
41
41
  pgpm init
42
+ cd packages/your-module
42
43
 
43
- # 3. Add a database change
44
- pgpm add some_change
44
+ # 3. Install a package
45
+ pgpm install @pgpm/faker
45
46
 
46
47
  # 4. Deploy everything
47
- pgpm deploy --createdb
48
+ pgpm deploy --createdb --database mydb1
49
+ psql -d mydb1 -c "SELECT faker.city('MI');"
50
+ > Ann Arbor
48
51
  ```
49
52
 
50
53
  ## 🛠️ Commands
@@ -98,7 +101,7 @@ pgpm deploy --createdb
98
101
 
99
102
  ## 💡 Common Workflows
100
103
 
101
- ### Starting a New Project
104
+ ### Starting a New Project and Adding a Change
102
105
 
103
106
  ```bash
104
107
  # 1. Create workspace
@@ -107,6 +110,7 @@ cd my-app
107
110
 
108
111
  # 2. Create your first module
109
112
  pgpm init
113
+ cd packages/new-module
110
114
 
111
115
  # 3. Add some SQL migrations to sql/ directory
112
116
  pgpm add some_change
@@ -118,21 +122,23 @@ pgpm deploy --createdb
118
122
  ### Working with Existing Projects
119
123
 
120
124
  ```bash
121
- # 1. Clone and enter project
122
- git clone <repo> && cd <project>
125
+ # 1. Navigate to your module
126
+ cd packages/your-module
123
127
 
124
- # 2. Install dependencies
125
- pgpm install
128
+ # 2. Install a package
129
+ pgpm install @pgpm/faker
126
130
 
127
- # 3. Deploy to local database
128
- pgpm deploy --createdb
131
+ # 3. Deploy all installed modules
132
+ pgpm deploy --createdb --database mydb1
133
+ psql -d mydb1 -c "SELECT faker.city('MI');"
134
+ > Ann Arbor
129
135
  ```
130
136
 
131
137
  ### Testing a pgpm module in a workspace
132
138
 
133
139
  ```bash
134
- # 1. Install dependencies
135
- pgpm install
140
+ # 1. Install workspace dependencies
141
+ pnpm install
136
142
 
137
143
  # 2. Enter the packages/<yourmodule>
138
144
  cd packages/yourmodule
@@ -286,89 +292,18 @@ pgpm kill
286
292
  pgpm kill --no-drop
287
293
  ```
288
294
 
289
- ## 💡 Common Workflows
290
-
291
- ### Starting a New Project
292
-
293
- ```bash
294
- # 1. Create workspace
295
- mkdir my-app && cd my-app
296
- pgpm init --workspace
297
-
298
- # 2. Create your first module
299
- pgpm init
300
-
301
- # 3. Add some SQL migrations to sql/ directory
302
- # 4. Deploy to database
303
- pgpm deploy --createdb
304
-
305
- # 5. Start developing
306
- pgpm server
307
- ```
308
-
309
- ### Using Custom Templates
310
-
311
- You can use custom templates from GitHub repositories or local paths:
312
-
313
- ```bash
314
- # Initialize workspace with templates from GitHub
315
- pgpm init --workspace --repo owner/repo
316
-
317
- # Initialize workspace with templates from local path
318
- pgpm init --workspace --template-path ./my-custom-templates
319
-
320
- # Initialize module with custom templates
321
- pgpm init --template-path ./my-custom-templates
322
-
323
- # Use specific branch from GitHub repository
324
- pgpm init --workspace --repo owner/repo --from-branch develop
325
- ```
326
-
327
- **Template Structure:**
328
- Custom templates should follow the same structure as the default templates:
329
-
330
- - For workspace: `boilerplates/workspace/` directory
331
- - For module: `boilerplates/module/` directory
332
- - Or provide direct path to `workspace/` or `module/` directory
333
-
334
- ### Working with Existing Projects
335
-
336
- ```bash
337
- # 1. Clone and enter project
338
- git clone <repo> && cd <project>
339
-
340
- # 2. Install dependencies
341
- pgpm install
342
-
343
- # 3. Deploy to local database
344
- pgpm deploy --createdb
295
+ ## ⚙️ Configuration
345
296
 
346
- # 4. Start development server
347
- pgpm server
348
- ```
297
+ ### Environment Variables
349
298
 
350
- ### Production Deployment
299
+ `pgpm` uses standard PostgreSQL environment variables (`PGHOST`, `PGPORT`, `PGDATABASE`, `PGUSER`, `PGPASSWORD`).
351
300
 
301
+ **Quick setup** (recommended):
352
302
  ```bash
353
- # 1. Create deployment plan
354
- pgpm plan
355
-
356
- # 2. Package module
357
- pgpm package
358
-
359
- # 3. Deploy to production
360
- pgpm deploy --package myapp --to @production
361
-
362
- # 4. Verify deployment
363
- pgpm verify --package myapp
303
+ eval "$(pgpm env)"
364
304
  ```
365
305
 
366
- ## ⚙️ Configuration
367
-
368
- ### Environment Variables
369
-
370
- LaunchQL respects standard PostgreSQL environment variables:
371
-
306
+ **Manual setup** (if you prefer):
372
307
  ```bash
373
308
  export PGHOST=localhost
374
309
  export PGPORT=5432
@@ -377,7 +312,12 @@ export PGUSER=postgres
377
312
  export PGPASSWORD=password
378
313
  ```
379
314
 
380
- ## 🆘 Getting Help
315
+ **Supabase local development:**
316
+ ```bash
317
+ eval "$(pgpm env --supabase)"
318
+ ```
319
+
320
+ ## Getting Help
381
321
 
382
322
  ### Command Help
383
323
 
@@ -387,7 +327,7 @@ pgpm --help
387
327
 
388
328
  # Command-specific help
389
329
  pgpm deploy --help
390
- pgpm server -h
330
+ pgpm tag -h
391
331
  ```
392
332
 
393
333
  ### Common Options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgpm",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "author": "Dan Lynch <pyramation@gmail.com>",
5
5
  "description": "PostgreSQL Package Manager - Database migration and package management CLI",
6
6
  "main": "index.js",
@@ -70,5 +70,5 @@
70
70
  "pg",
71
71
  "pgsql"
72
72
  ],
73
- "gitHead": "bc6476c6a5730970be08bb4127cbf79fe5965202"
73
+ "gitHead": "a871ed840bbc63854182bacec695324521eb3762"
74
74
  }