You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And then use them like in SQL `select say_hello('world')`.
107
+
108
+
Custom functions support overloading and variadic arguments.
109
+
110
+
⚠ However, the value you return is not type checked. It MUST correspond to the datatype you provided as 'returns' (wont fail if not, but could lead to weird bugs).
111
+
112
+
113
+
## Extensions
114
+
115
+
No native extension is implemented (pull requests are welcome), but you can define kind-of extensions like this:
116
+
117
+
```typescript
118
+
119
+
db.registerExtension('my-ext', schema=> {
120
+
// install your ext in 'schema'
121
+
// ex: schema.registerFunction(...)
122
+
});
123
+
```
124
+
125
+
Statements like `create extension "my-ext"` will then be supported.
126
+
93
127
# 📃 Libraries adapters
94
128
95
129
@@ -190,45 +224,9 @@ __NB: Restore points only work if the schema has not been changed after the rest
190
224
191
225
note: You must install `typeorm` module first.
192
226
193
-
# Other features
194
-
195
-
## Custom functions
196
-
197
-
You can declare custom functions like this:
198
-
199
-
```typescript
200
-
db.public.registerFunction({
201
-
name: 'say_hello',
202
-
args: [DataType.text],
203
-
returns: DataType.text,
204
-
implementation: x=>'hello '+x,
205
-
})
206
-
```
207
-
208
-
And then use them like in SQL `select say_hello('world')`.
209
-
210
-
Custom functions support overloading and variadic arguments.
211
-
212
-
⚠ However, the value you return is not type checked. It MUST correspond to the datatype you provided as 'returns' (wont fail if not, but could lead to weird bugs).
213
-
214
-
215
-
## Extensions
216
-
217
-
No native extension is implemented (pull requests are welcome), but you can define kind-of extensions like this:
218
-
219
-
```typescript
220
-
221
-
db.registerExtension('my-ext', schema=> {
222
-
// install your ext in 'schema'
223
-
// ex: schema.registerFunction(...)
224
-
});
225
-
```
226
-
227
-
Statements like `create extension "my-ext"` will then be supported.
0 commit comments