sqlx-ts 0.23.0 → 0.24.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/README.md +16 -0
- package/package.json +1 -1
- package/sqlx-ts +0 -0
package/README.md
CHANGED
|
@@ -78,6 +78,22 @@ const { sql } = require('sqlx-ts')
|
|
|
78
78
|
const query = sql`SELECT * FROM some_table;`
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
#### Using Raw SQL Files
|
|
82
|
+
|
|
83
|
+
Create a SQL file with annotations:
|
|
84
|
+
|
|
85
|
+
```sql
|
|
86
|
+
-- users.sql
|
|
87
|
+
-- @name: getUserById
|
|
88
|
+
SELECT id, name, email FROM users WHERE id = $1;
|
|
89
|
+
|
|
90
|
+
-- @name: createUser
|
|
91
|
+
INSERT INTO users (name, email) VALUES ($1, $2) RETURNING id;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Then, you can use the `sqlx-ts` CLI to generate TypeScript types and check the SQL queries
|
|
95
|
+
|
|
96
|
+
|
|
81
97
|
##### Installing binary separately
|
|
82
98
|
|
|
83
99
|
You may choose to install sqlx-ts separately instead of using `npm i`
|
package/package.json
CHANGED
package/sqlx-ts
CHANGED
|
Binary file
|