@m2k-5f/pgtx 1.0.3 → 1.0.5

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 +5 -5
  2. package/package.json +9 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Pgtx 🚀
1
+ ## Pgtx 🚀
2
2
 
3
3
  A lightweight, **high-performance** SQL query builder for `node-postgres` (pg).
4
4
  Experience ORM-like convenience (auto-inserts, updates, recursive fragments) with the transparency and speed of raw SQL.
@@ -68,7 +68,7 @@ await pool.query`
68
68
  // SQL: INSERT INTO users ... VALUES ($1, (SELECT id FROM roles WHERE name = $2)) WHERE status = $3 AND age > $4
69
69
  ```
70
70
 
71
- ## 2. Transactions
71
+ ### 2. Transactions
72
72
  Automatic BEGIN, COMMIT, and ROLLBACK. Use savepoint for nested logic.
73
73
 
74
74
  ```typescript
@@ -84,7 +84,7 @@ await pool.begin(async (tx) => {
84
84
  // Main transaction commits or rolls back based on callback success
85
85
  ```
86
86
 
87
- ## 3. Bulk Inserts (sql.insert)
87
+ ### 3. Bulk Inserts (sql.insert)
88
88
  Automatically extracts columns from the first object. Supports single objects and arrays.
89
89
 
90
90
  ```typescript
@@ -97,7 +97,7 @@ await pool.query`INSERT INTO users ${sql.insert(users)}`
97
97
  // SQL: INSERT INTO users (name, email) VALUES ($1, $2), ($3, $4)
98
98
  ```
99
99
 
100
- ## 4. Prepared Statements
100
+ ### 4. Prepared Statements
101
101
  Pre-parse SQL on the database server for maximum performance in hot loops.
102
102
 
103
103
  ```typescript
@@ -129,7 +129,7 @@ await pool.query`SELECT * FROM users WHERE ${sql.array(conds, ' AND ')}`
129
129
  // SQL: SELECT * FROM users WHERE active = true AND age > $1
130
130
  ```
131
131
 
132
- ## 6. Dynamic Updates (sql.update)
132
+ ### 6. Dynamic Updates (sql.update)
133
133
  Easily generate SET clauses from plain JavaScript objects.
134
134
 
135
135
  ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m2k-5f/pgtx",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Lightweight, high-performance SQL toolkit for node-postgres",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -12,9 +12,17 @@
12
12
  "build": "tsc",
13
13
  "prepublishOnly": "npm run build"
14
14
  },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git://github.com/M2K-5F/pgtx.git"
18
+ },
15
19
  "keywords": ["sql", "postgres", "pg", "query-builder", "typescript", "transactions", "prepared-statements"],
16
20
  "author": "M2K-5F",
17
21
  "license": "MIT",
22
+ "homepage": "https://github.com/M2K-5F/pgtx",
23
+ "bugs": {
24
+ "url": "https://github.com/M2K-5F/pgtx/issues"
25
+ },
18
26
  "dependencies": {
19
27
  "pg": "^8.11.0"
20
28
  },