@pgpm/base32 0.6.0 → 0.7.0
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/Makefile
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @pgpm/base32
|
|
2
2
|
|
|
3
|
+
<p align="center" width="100%">
|
|
4
|
+
<img height="250" src="https://raw.githubusercontent.com/launchql/launchql/refs/heads/main/assets/outline-logo.svg" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center" width="100%">
|
|
8
|
+
<a href="https://github.com/launchql/pgpm-modules/actions/workflows/ci.yml">
|
|
9
|
+
<img height="20" src="https://github.com/launchql/pgpm-modules/actions/workflows/ci.yml/badge.svg" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://github.com/launchql/pgpm-modules/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@pgpm/base32"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/pgpm-modules?filename=packages%2Futils%2Fbase32%2Fpackage.json"/></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
3
15
|
RFC4648 Base32 encode/decode in plpgsql
|
|
4
16
|
|
|
5
17
|
## Overview
|
|
@@ -29,40 +41,42 @@ This is a quick way to get started. The sections below provide more detailed ins
|
|
|
29
41
|
### Prerequisites
|
|
30
42
|
|
|
31
43
|
```bash
|
|
32
|
-
# Install pgpm
|
|
44
|
+
# Install pgpm CLI
|
|
33
45
|
npm install -g pgpm
|
|
34
46
|
|
|
35
|
-
# Start
|
|
47
|
+
# Start local Postgres (via Docker) and export env vars
|
|
36
48
|
pgpm docker start
|
|
37
|
-
|
|
38
|
-
# Set environment variables
|
|
39
49
|
eval "$(pgpm env)"
|
|
40
50
|
```
|
|
41
51
|
|
|
42
|
-
|
|
52
|
+
> **Tip:** Already running Postgres? Skip the Docker step and just export your `PG*` environment variables.
|
|
43
53
|
|
|
44
|
-
|
|
54
|
+
### **Add to an Existing Package**
|
|
45
55
|
|
|
46
56
|
```bash
|
|
57
|
+
# 1. Install the package
|
|
47
58
|
pgpm install @pgpm/base32
|
|
48
|
-
|
|
59
|
+
|
|
60
|
+
# 2. Deploy locally
|
|
61
|
+
pgpm deploy
|
|
49
62
|
```
|
|
50
63
|
|
|
51
|
-
|
|
64
|
+
### **Add to a New Project**
|
|
52
65
|
|
|
53
66
|
```bash
|
|
54
|
-
|
|
55
|
-
pgpm
|
|
56
|
-
|
|
67
|
+
# 1. Create a workspace
|
|
68
|
+
pgpm init --workspace
|
|
69
|
+
cd my-app
|
|
57
70
|
|
|
58
|
-
|
|
71
|
+
# 2. Create your first module
|
|
72
|
+
pgpm init
|
|
73
|
+
cd packages/your-module
|
|
59
74
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
pnpm install
|
|
75
|
+
# 3. Install a package
|
|
76
|
+
pgpm install @pgpm/base32
|
|
63
77
|
|
|
64
|
-
# Deploy
|
|
65
|
-
pgpm deploy
|
|
78
|
+
# 4. Deploy everything
|
|
79
|
+
pgpm deploy --createdb --database mydb1
|
|
66
80
|
```
|
|
67
81
|
|
|
68
82
|
## Usage
|
|
@@ -235,141 +249,6 @@ https://tools.ietf.org/html/rfc4648
|
|
|
235
249
|
|
|
236
250
|
https://www.youtube.com/watch?v=Va8FLD-iuTg
|
|
237
251
|
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
## Development
|
|
241
|
-
|
|
242
|
-
## start the postgres db process
|
|
243
|
-
|
|
244
|
-
First you'll want to start the postgres docker (you can also just use `docker-compose up -d`):
|
|
245
|
-
|
|
246
|
-
```sh
|
|
247
|
-
make up
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
## install modules
|
|
251
|
-
|
|
252
|
-
Install modules
|
|
253
|
-
|
|
254
|
-
```sh
|
|
255
|
-
yarn install
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
## install the Postgres extensions
|
|
259
|
-
|
|
260
|
-
Now that the postgres process is running, install the extensions:
|
|
261
|
-
|
|
262
|
-
```sh
|
|
263
|
-
make install
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
This basically `ssh`s into the postgres instance with the `packages/` folder mounted as a volume, and installs the bundled sql code as pgxn extensions.
|
|
267
|
-
|
|
268
|
-
## testing
|
|
269
|
-
|
|
270
|
-
Testing will load all your latest sql changes and create fresh, populated databases for each sqitch module in `packages/`.
|
|
271
|
-
|
|
272
|
-
```sh
|
|
273
|
-
yarn test:watch
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
## building new modules
|
|
277
|
-
|
|
278
|
-
Create a new folder in `packages/`
|
|
279
|
-
|
|
280
|
-
```sh
|
|
281
|
-
pgpm init
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Then, run a generator:
|
|
285
|
-
|
|
286
|
-
```sh
|
|
287
|
-
pgpm generate
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
You can also add arguments if you already know what you want to do:
|
|
291
|
-
|
|
292
|
-
```sh
|
|
293
|
-
pgpm generate schema --schema myschema
|
|
294
|
-
pgpm generate table --schema myschema --table mytable
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
## deploy code as extensions
|
|
298
|
-
|
|
299
|
-
`cd` into `packages/<module>`, and run `pgpm package`. This will make an sql file in `packages/<module>/sql/` used for `CREATE EXTENSION` calls to install your sqitch module as an extension.
|
|
300
|
-
|
|
301
|
-
## recursive deploy
|
|
302
|
-
|
|
303
|
-
You can also deploy all modules utilizing versioning as sqtich modules. Remove `--createdb` if you already created your db:
|
|
304
|
-
|
|
305
|
-
```sh
|
|
306
|
-
pgpm deploy mydb1 --yes --createdb
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
---
|
|
310
|
-
|
|
311
|
-
### **Before You Begin**
|
|
312
|
-
|
|
313
|
-
```bash
|
|
314
|
-
# 1. Install pgpm
|
|
315
|
-
npm install -g pgpm
|
|
316
|
-
|
|
317
|
-
# 2. Start Postgres (Docker or local)
|
|
318
|
-
pgpm docker start
|
|
319
|
-
|
|
320
|
-
# 3. Load PG* environment variables (PGHOST, PGUSER, ...)
|
|
321
|
-
eval "$(pgpm env)"
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
---
|
|
325
|
-
|
|
326
|
-
### **Starting a New Project**
|
|
327
|
-
|
|
328
|
-
```bash
|
|
329
|
-
# 1. Create a workspace
|
|
330
|
-
pgpm init --workspace
|
|
331
|
-
cd my-app
|
|
332
|
-
|
|
333
|
-
# 2. Create your first module
|
|
334
|
-
pgpm init
|
|
335
|
-
|
|
336
|
-
# 3. Add a migration
|
|
337
|
-
pgpm add some_change
|
|
338
|
-
|
|
339
|
-
# 4. Deploy (auto-creates database)
|
|
340
|
-
pgpm deploy --createdb
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
### **Working With an Existing Project**
|
|
346
|
-
|
|
347
|
-
```bash
|
|
348
|
-
# 1. Clone and enter the project
|
|
349
|
-
git clone <repo> && cd <project>
|
|
350
|
-
|
|
351
|
-
# 2. Install dependencies
|
|
352
|
-
pnpm install
|
|
353
|
-
|
|
354
|
-
# 3. Deploy locally
|
|
355
|
-
pgpm deploy --createdb
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
---
|
|
359
|
-
|
|
360
|
-
### **Testing a Module Inside a Workspace**
|
|
361
|
-
|
|
362
|
-
```bash
|
|
363
|
-
# 1. Install workspace deps
|
|
364
|
-
pnpm install
|
|
365
|
-
|
|
366
|
-
# 2. Enter the module directory
|
|
367
|
-
cd packages/<some-module>
|
|
368
|
-
|
|
369
|
-
# 3. Run tests in watch mode
|
|
370
|
-
pnpm test:watch
|
|
371
|
-
```
|
|
372
|
-
|
|
373
252
|
## Related Tooling
|
|
374
253
|
|
|
375
254
|
* [pgpm](https://github.com/launchql/launchql/tree/main/packages/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
|
package/launchql-base32.control
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpm/base32",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Base32 encoding and decoding functions for PostgreSQL",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test:watch": "jest --watch"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@pgpm/verify": "0.
|
|
14
|
+
"@pgpm/verify": "0.7.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"pgpm": "^0.2.0"
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"bugs": {
|
|
25
25
|
"url": "https://github.com/launchql/pgpm-modules/issues"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "1f24d8fa95fb141f16e5b8345458c3b687d80908"
|
|
28
28
|
}
|
|
File without changes
|