pg-query-sdk 1.0.1 → 1.0.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.
- package/README.md +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ npm install pg-query-sdk
|
|
|
35
35
|
The `Database` class serves as the primary interface for all database interactions. Instantiate it with your PostgreSQL connection string.
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
|
-
import Database from 'pg-query-sdk';
|
|
38
|
+
import {Database} from 'pg-query-sdk';
|
|
39
39
|
|
|
40
40
|
const db = new Database({
|
|
41
41
|
connectionString: 'postgres://user:pass@localhost:5432/your_database',
|
|
@@ -51,7 +51,7 @@ const db = new Database({
|
|
|
51
51
|
The `QueryBuilder` enables the programmatic construction of SQL `SELECT` statements, accessible via the `db.table()` method.
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
|
-
import Database from 'pg-query-sdk';
|
|
54
|
+
import {Database} from 'pg-query-sdk';
|
|
55
55
|
|
|
56
56
|
const db = new Database({
|
|
57
57
|
connectionString: 'postgres://user:pass@localhost:5432/your_database',
|
|
@@ -76,7 +76,7 @@ selectExample();
|
|
|
76
76
|
The `ConditionBuilder` facilitates the creation of complex conditional logic within `WHERE` and `HAVING` clauses, typically used in conjunction with the `QueryBuilder`.
|
|
77
77
|
|
|
78
78
|
```typescript
|
|
79
|
-
import Database from 'pg-query-sdk';
|
|
79
|
+
import {Database} from 'pg-query-sdk';
|
|
80
80
|
|
|
81
81
|
const db = new Database({
|
|
82
82
|
connectionString: 'postgres://user:pass@localhost:5432/your_database',
|
|
@@ -129,7 +129,7 @@ directExecuteExample();
|
|
|
129
129
|
The SDK provides robust support for managing ACID-compliant transactions, ensuring data integrity.
|
|
130
130
|
|
|
131
131
|
```typescript
|
|
132
|
-
import Database from 'pg-query-sdk';
|
|
132
|
+
import {Database} from 'pg-query-sdk';
|
|
133
133
|
|
|
134
134
|
const db = new Database({
|
|
135
135
|
connectionString: 'postgres://user:pass@localhost:5432/your_database',
|
|
@@ -164,7 +164,7 @@ transactionExample();
|
|
|
164
164
|
The abstract `Repository<T>` class offers a foundational ORM layer, providing methods like `findById` and a pre-configured `QueryBuilder` (`qb()`). Custom DML operations (`insert`, `update`, `delete`) should be implemented in concrete repository classes.
|
|
165
165
|
|
|
166
166
|
```typescript
|
|
167
|
-
import Database,
|
|
167
|
+
import {Database, Repository } from 'pg-query-sdk';
|
|
168
168
|
import { QueryExecutor, Dialect } from 'pg-query-sdk';
|
|
169
169
|
|
|
170
170
|
interface User {
|
|
@@ -221,7 +221,7 @@ const db = new Database({ /* ... */ });
|
|
|
221
221
|
### ESM
|
|
222
222
|
|
|
223
223
|
```typescript
|
|
224
|
-
import Database from 'pg-query-sdk';
|
|
224
|
+
import {Database} from 'pg-query-sdk';
|
|
225
225
|
const db = new Database({ /* ... */ });
|
|
226
226
|
```
|
|
227
227
|
|