@triptease/sql-template 0.17.18 → 0.20.21
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 +29 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Sql Template
|
|
2
|
+
|
|
3
|
+
This is yet another SQL tagged template for Typescript/Javascript
|
|
4
|
+
|
|
5
|
+
## Why another library?
|
|
6
|
+
|
|
7
|
+
* Typescript first
|
|
8
|
+
* Functional/Immutable
|
|
9
|
+
* Super simple implementaion (the main SQL function is [3 lines of code](https://github.com/triptease/sql-template/blob/master/sql-template/src/SQL.ts#L5))
|
|
10
|
+
* Plugable to any DB (currently has a Postgres function in @triptease\sql-template-postgres)
|
|
11
|
+
* Automatic support for prepareStatement naming (Postgres)
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
npm install @triptease\sql-template @triptease\sql-template-postgres
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
import {SQL} from "@triptease/sql-template";
|
|
23
|
+
import {statement} from "@triptease/sql-template-postgres";
|
|
24
|
+
|
|
25
|
+
pg.query(statement(SQL`select * from user where name = ${name}`));
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
WIP more to come
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@triptease/sql-template",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.21",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@github.com/triptease/sql-template.git"
|
|
@@ -22,5 +22,6 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"tslib": "^2.3.1"
|
|
24
24
|
},
|
|
25
|
-
"scripts": {}
|
|
25
|
+
"scripts": {},
|
|
26
|
+
"readme": "# Sql Template\r\n\r\nThis is yet another SQL tagged template for Typescript/Javascript\r\n\r\n## Why another library?\r\n\r\n* Typescript first\r\n* Functional/Immutable\r\n* Super simple implementaion (the main SQL function is [3 lines of code](https://github.com/triptease/sql-template/blob/master/sql-template/src/SQL.ts#L5))\r\n* Plugable to any DB (currently has a Postgres function in @triptease\\sql-template-postgres)\r\n* Automatic support for prepareStatement naming (Postgres)\r\n\r\n## Installation\r\n\r\n```\r\nnpm install @triptease\\sql-template @triptease\\sql-template-postgres\r\n```\r\n\r\n## Usage\r\n\r\n```\r\nimport {SQL} from \"@triptease/sql-template\";\r\nimport {statement} from \"@triptease/sql-template-postgres\";\r\n\r\npg.query(statement(SQL`select * from user where name = ${name}`));\r\n\r\n```\r\n\r\nWIP more to come\r\n"
|
|
26
27
|
}
|