sqlx-ts 0.22.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.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/package.json +1 -1
  3. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sqlx-ts",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "sqlx-ts ensures your raw SQLs are compile-time checked",
5
5
  "main": "dist/index.js",
6
6
  "maintainers": [
package/sqlx-ts CHANGED
Binary file