@faasjs/knex 0.0.2-beta.360 → 0.0.2-beta.364

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 +119 -2
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,7 +1,124 @@
1
1
  # @faasjs/knex
2
2
 
3
- Knex 插件
4
-
5
3
  [![License: MIT](https://img.shields.io/npm/l/@faasjs/knex.svg)](https://github.com/faasjs/faasjs/blob/main/packages/faasjs/knex/LICENSE)
6
4
  [![NPM Stable Version](https://img.shields.io/npm/v/@faasjs/knex/stable.svg)](https://www.npmjs.com/package/@faasjs/knex)
7
5
  [![NPM Beta Version](https://img.shields.io/npm/v/@faasjs/knex/beta.svg)](https://www.npmjs.com/package/@faasjs/knex)
6
+
7
+ FaasJS's sql plugin, base on [Knex](https://knexjs.org/).
8
+
9
+ ## Install
10
+
11
+ npm install @faasjs/knex
12
+ ## Modules
13
+
14
+ ### Classes
15
+
16
+ - [Knex](classes/Knex.md)
17
+
18
+ ### Type aliases
19
+
20
+ - [KnexConfig](#knexconfig)
21
+
22
+ ### Functions
23
+
24
+ - [query](#query)
25
+ - [raw](#raw)
26
+ - [transaction](#transaction)
27
+ - [useKnex](#useknex)
28
+
29
+ ## Type aliases
30
+
31
+ ### KnexConfig
32
+
33
+ Ƭ **KnexConfig**: `Object`
34
+
35
+ #### Type declaration
36
+
37
+ | Name | Type |
38
+ | :------ | :------ |
39
+ | `config?` | `K.Config` |
40
+ | `name?` | `string` |
41
+
42
+ ## Functions
43
+
44
+ ### query
45
+
46
+ ▸ **query**<`TName`\>(`table`): `QueryBuilder`<`TableType`<`TName`\>, `DeferredKeySelection`<`ResolveTableType`<`TableType`<`TName`\>, ``"base"``\>, `never`, ``false``, {}, ``false``, {}, `never`\>[]\>
47
+
48
+ #### Type parameters
49
+
50
+ | Name | Type |
51
+ | :------ | :------ |
52
+ | `TName` | extends `never` |
53
+
54
+ #### Parameters
55
+
56
+ | Name | Type |
57
+ | :------ | :------ |
58
+ | `table` | `TName` |
59
+
60
+ #### Returns
61
+
62
+ `QueryBuilder`<`TableType`<`TName`\>, `DeferredKeySelection`<`ResolveTableType`<`TableType`<`TName`\>, ``"base"``\>, `never`, ``false``, {}, ``false``, {}, `never`\>[]\>
63
+
64
+ ___
65
+
66
+ ### raw
67
+
68
+ ▸ **raw**<`TResult`\>(`sql`, `bindings?`): `Promise`<`K.Raw`<`TResult`\>\>
69
+
70
+ #### Type parameters
71
+
72
+ | Name | Type |
73
+ | :------ | :------ |
74
+ | `TResult` | `any` |
75
+
76
+ #### Parameters
77
+
78
+ | Name | Type | Default value |
79
+ | :------ | :------ | :------ |
80
+ | `sql` | `string` | `undefined` |
81
+ | `bindings` | `RawBinding`[] \| `ValueDict` | `[]` |
82
+
83
+ #### Returns
84
+
85
+ `Promise`<`K.Raw`<`TResult`\>\>
86
+
87
+ ___
88
+
89
+ ### transaction
90
+
91
+ ▸ **transaction**<`TResult`\>(`scope`, `config?`): `Promise`<`TResult`\>
92
+
93
+ #### Type parameters
94
+
95
+ | Name | Type |
96
+ | :------ | :------ |
97
+ | `TResult` | `any` |
98
+
99
+ #### Parameters
100
+
101
+ | Name | Type |
102
+ | :------ | :------ |
103
+ | `scope` | (`trx`: `Transaction`<`any`, `any`\>) => `void` \| `Promise`<`TResult`\> |
104
+ | `config?` | `any` |
105
+
106
+ #### Returns
107
+
108
+ `Promise`<`TResult`\>
109
+
110
+ ___
111
+
112
+ ### useKnex
113
+
114
+ ▸ **useKnex**(`config?`): [`Knex`](classes/Knex.md) & `UseifyPlugin`
115
+
116
+ #### Parameters
117
+
118
+ | Name | Type |
119
+ | :------ | :------ |
120
+ | `config?` | [`KnexConfig`](#knexconfig) |
121
+
122
+ #### Returns
123
+
124
+ [`Knex`](classes/Knex.md) & `UseifyPlugin`
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@faasjs/knex",
3
- "version": "0.0.2-beta.360",
3
+ "version": "0.0.2-beta.364",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
- "homepage": "https://faasjs.com/doc/knex.html",
7
+ "homepage": "https://faasjs.com/doc/knex",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/faasjs/faasjs.git",
@@ -22,9 +22,9 @@
22
22
  "dist"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@faasjs/deep_merge": "^0.0.2-beta.360",
26
- "@faasjs/func": "^0.0.2-beta.360",
27
- "@faasjs/logger": "^0.0.2-beta.360",
25
+ "@faasjs/deep_merge": "^0.0.2-beta.364",
26
+ "@faasjs/func": "^0.0.2-beta.364",
27
+ "@faasjs/logger": "^0.0.2-beta.364",
28
28
  "knex": "*"
29
29
  },
30
30
  "devDependencies": {