1#[derive(Debug, Clone)]
8pub struct BuiltinFn {
9 pub name: &'static str,
10 pub description: &'static str,
11 pub signatures: &'static [&'static str],
12}
13
14pub static BUILTIN_NAMESPACES: &[&str] = &[
16 "api",
17 "api::req",
18 "api::res",
19 "array",
20 "array::sort",
21 "bytes",
22 "crypto",
23 "crypto::argon2",
24 "crypto::bcrypt",
25 "crypto::pbkdf2",
26 "crypto::scrypt",
27 "duration",
28 "file",
29 "geo",
30 "geo::hash",
31 "http",
32 "math",
33 "meta",
34 "object",
35 "parse::email",
36 "parse::url",
37 "rand",
38 "rand::uuid",
39 "record",
40 "search",
41 "sequence",
42 "session",
43 "set",
44 "string",
45 "string::distance",
46 "string::html",
47 "string::semver",
48 "string::semver::inc",
49 "string::semver::set",
50 "string::similarity",
51 "time",
52 "type",
53 "value",
54 "vector",
55 "vector::distance",
56 "vector::similarity",
57];
58
59pub static BUILTINS: &[BuiltinFn] = &[
61 BuiltinFn {
62 name: "api::invoke",
63 description: "Built-in function api::invoke",
64 signatures: &["api::invoke($path: string, $options: option<object>) -> object"],
65 },
66 BuiltinFn {
67 name: "api::req::body",
68 description: "Built-in function api::req::body",
69 signatures: &["api::req::body($path: string, $strategy: option<string>)"],
70 },
71 BuiltinFn {
72 name: "api::res::body",
73 description: "Built-in function api::res::body",
74 signatures: &["api::res::body($path: string, $strategy: option<string>)"],
75 },
76 BuiltinFn {
77 name: "api::res::header",
78 description: "The api::res::header function sets a single header for a response.",
79 signatures: &["api::res::header($header_name: string, $val: value)"],
80 },
81 BuiltinFn {
82 name: "api::res::headers",
83 description: "The api::res::headers function takes an object to set the headers for a response.",
84 signatures: &["api::res::headers($headers: object)"],
85 },
86 BuiltinFn {
87 name: "api::res::status",
88 description: "Built-in function api::res::status",
89 signatures: &["api::res::status($http_code: int)"],
90 },
91 BuiltinFn {
92 name: "api::timeout",
93 description: "The api::timeout function sets the maximum timeout for a request.",
94 signatures: &["api::timeout($timeout: duration)"],
95 },
96 BuiltinFn {
97 name: "array::add",
98 description: "The array::add function adds an item to an array only if it doesn't exist.",
99 signatures: &["array::add(array, $new_val: value) -> array"],
100 },
101 BuiltinFn {
102 name: "array::all",
103 description: "When called on an array without any extra arguments, the array::all function checks whether all array values are truthy.",
104 signatures: &[
105 "array::all(array) -> bool",
106 "array::all(array, $predicate: value) -> bool",
107 "array::all(array, $predicate: closure) -> bool",
108 ],
109 },
110 BuiltinFn {
111 name: "array::any",
112 description: "The array::any function checks whether any array values are truthy.",
113 signatures: &[
114 "array::any(array) -> bool",
115 "array::any(array, $predicate: value) -> bool",
116 "array::any(array, $predicate: closure) -> bool",
117 ],
118 },
119 BuiltinFn {
120 name: "array::append",
121 description: "The array::append function appends a value to the end of an array.",
122 signatures: &["array::append(array, $new_val: value) -> array"],
123 },
124 BuiltinFn {
125 name: "array::at",
126 description: "The array::at function returns the value at the specified index, or in reverse for a negative index.",
127 signatures: &["array::at(array, $index: int) -> any"],
128 },
129 BuiltinFn {
130 name: "array::boolean_and",
131 description: "The array::boolean_and function performs the AND bitwise operations on the input arrays per-element based on the element's truthiness. If one array is shorter than the other it is considered null a...",
132 signatures: &["array::boolean_and($lh: array, $rh: array)"],
133 },
134 BuiltinFn {
135 name: "array::boolean_not",
136 description: "The array::boolean_not function performs the NOT bitwise operations on the input array(s) per-element based on the element's truthiness. It takes in one array and it returns false if its single ope...",
137 signatures: &["array::boolean_not(array)"],
138 },
139 BuiltinFn {
140 name: "array::boolean_or",
141 description: "The array::boolean_or function performs the OR bitwise operations on the input arrays per-element based on the element's truthiness. It takes two arrays and if one array is shorter than the other o...",
142 signatures: &["array::boolean_or($lh: array, $rh: array)"],
143 },
144 BuiltinFn {
145 name: "array::boolean_xor",
146 description: "The array::boolean_xor function performs the XOR bitwise operations.",
147 signatures: &["array::boolean_xor($lh: array, $rh: array)"],
148 },
149 BuiltinFn {
150 name: "array::clump",
151 description: "The array::clump function returns the original array split into sub-arrays of size. The last sub-array may have a length less than the length of size if size does not divide equally into the origin...",
152 signatures: &["array::clump(array, $size: int) -> array"],
153 },
154 BuiltinFn {
155 name: "array::combine",
156 description: "The array::combine function combines all values from two arrays together, returning an array of arrays.",
157 signatures: &["array::combine(array, $other: array) -> array"],
158 },
159 BuiltinFn {
160 name: "array::complement",
161 description: "The array::complement function returns the complement of two arrays, returning a single array containing items which are not in the second array.",
162 signatures: &["array::complement(array, $other: array) -> array"],
163 },
164 BuiltinFn {
165 name: "array::concat",
166 description: "The array::concat function merges an array with one or more arrays, returning an array which may contain duplicate values. If you want to remove duplicate values from two merged arrays, then use th...",
167 signatures: &["array::concat(array, $other: array, ..) -> array"],
168 },
169 BuiltinFn {
170 name: "array::difference",
171 description: "The array::difference function determines the difference between two arrays, returning a single array containing items which are not in both arrays.",
172 signatures: &["array::difference(array, $other: array) -> array"],
173 },
174 BuiltinFn {
175 name: "array::distinct",
176 description: "The array::distinct function calculates the unique values in an array, returning a single array.",
177 signatures: &["array::distinct(array) -> array"],
178 },
179 BuiltinFn {
180 name: "array::fill",
181 description: "The array::fill function replaces all values of an array with a new value.",
182 signatures: &[
183 "array::fill(array, $with: any) -> array",
184 "array::fill(array, $with: any, $start: int, $end: int) -> array",
185 ],
186 },
187 BuiltinFn {
188 name: "array::filter",
189 description: "The array::filter function filters out values in an array that do not match a pattern, returning only the ones that do match.",
190 signatures: &[
191 "array::filter(array, $predicate: value) -> array",
192 "array::filter(array, $predicate: closure) -> array",
193 ],
194 },
195 BuiltinFn {
196 name: "array::filter_index",
197 description: "The array::filter_index function returns the indexes of all occurrences of all matching values.",
198 signatures: &[
199 "array::filter_index(array, $predicate: value) -> array",
200 "array::filter_index(array, $predicate: closure) -> array",
201 ],
202 },
203 BuiltinFn {
204 name: "array::find",
205 description: "The array::find function returns the first occurrence of value in the array or NONE if array does not contain value.",
206 signatures: &[
207 "array::find(array, $predicate: value) -> value | NONE",
208 "array::find(array, $predicate: closure) -> value | NONE",
209 ],
210 },
211 BuiltinFn {
212 name: "array::find_index",
213 description: "The array::find_index function returns the index of the first occurrence of value in the array or NONE if array does not contain value.",
214 signatures: &[
215 "array::find_index(array, $predicate: value) -> number | NONE",
216 "array::find_index(array, $predicate: closure) -> number | NONE",
217 ],
218 },
219 BuiltinFn {
220 name: "array::first",
221 description: "The array::first function returns the first value from an array.",
222 signatures: &["array::first(array) -> any"],
223 },
224 BuiltinFn {
225 name: "array::flatten",
226 description: "The array::flatten function flattens an array of arrays, returning a new array with all sub-array elements concatenated into it.",
227 signatures: &["array::flatten(array) -> array"],
228 },
229 BuiltinFn {
230 name: "array::fold",
231 description: "The array::fold function returns a final value from the elements of an array by allowing an operation to be performed at each step of the way as each subsequent item in the array is encountered. To...",
232 signatures: &["array::fold(array, $initial_value: value, $operator: closure) -> value"],
233 },
234 BuiltinFn {
235 name: "array::group",
236 description: "The array::group function flattens and returns the unique items in an array.",
237 signatures: &["array::group(array) -> array"],
238 },
239 BuiltinFn {
240 name: "array::insert",
241 description: "The array::insert function inserts a value into an array.",
242 signatures: &[
243 "array::insert(array, $insert: value) -> array",
244 "array::insert(array, $insert: value, $position: int) -> array",
245 ],
246 },
247 BuiltinFn {
248 name: "array::intersect",
249 description: "The array::intersect function calculates the values which intersect two arrays, returning a single array containing the values which are in both arrays.",
250 signatures: &["array::intersect(array, $other: array) -> array"],
251 },
252 BuiltinFn {
253 name: "array::is_empty",
254 description: "The array::is_empty function checks whether the array contains values.",
255 signatures: &["array::is_empty(array) -> bool"],
256 },
257 BuiltinFn {
258 name: "array::join",
259 description: "The array::join function takes an array and a string as parameters and returns a concatenated string.",
260 signatures: &["array::join(array, $concat_with: string) -> string"],
261 },
262 BuiltinFn {
263 name: "array::last",
264 description: "The array::last function returns the last value from an array.",
265 signatures: &["array::last(array) -> any"],
266 },
267 BuiltinFn {
268 name: "array::len",
269 description: "The array::len function calculates the length of an array, returning a number. This function includes all items when counting the number of items in the array. If you want to only count truthy valu...",
270 signatures: &["array::len(array) -> number"],
271 },
272 BuiltinFn {
273 name: "array::logical_and",
274 description: "The array::logical_and function performs the AND logical operation element-wise between two arrays. The resulting array will have a length of the longer of the two input arrays, where each element ...",
275 signatures: &["array::logical_and($lh: array, $rh: array)"],
276 },
277 BuiltinFn {
278 name: "array::logical_or",
279 description: "The array::logical_or function performs the OR logical operations element-wise between two arrays.",
280 signatures: &["array::logical_or($lh: array, $rh: array)"],
281 },
282 BuiltinFn {
283 name: "array::logical_xor",
284 description: "The array::logical_xor function performs the XOR logical operations element-wise between two arrays.",
285 signatures: &["array::logical_xor($lh: array, $rh: array)"],
286 },
287 BuiltinFn {
288 name: "array::map",
289 description: "The array::map function allows the user to call an anonymous function (closure) that is performed on every item in the array before passing it on.",
290 signatures: &["array::map(array, $operator: closure) -> array;"],
291 },
292 BuiltinFn {
293 name: "array::matches",
294 description: "The array::matches function returns an array of booleans indicating which elements of the input array contain a specified value.",
295 signatures: &["array::matches(array, $predicate: value) -> array<bool>"],
296 },
297 BuiltinFn {
298 name: "array::max",
299 description: "The array::max function returns the greatest value from an array of values.",
300 signatures: &["array::max(array<any>) -> any"],
301 },
302 BuiltinFn {
303 name: "array::min",
304 description: "The array::min function returns the least value from an array of values.",
305 signatures: &["array::min(array<any>) -> any"],
306 },
307 BuiltinFn {
308 name: "array::pop",
309 description: "The array::pop function removes a value from the end of an array and returns it. If the array is empty, NONE is returned.",
310 signatures: &["array::pop(array) -> value"],
311 },
312 BuiltinFn {
313 name: "array::prepend",
314 description: "The array::prepend function prepends a value to the beginning of an array.",
315 signatures: &["array::prepend(array, $new_val: value) -> array"],
316 },
317 BuiltinFn {
318 name: "array::push",
319 description: "The array::push function appends a value to the end of an array.",
320 signatures: &["array::push(array, $new_val: value) -> array"],
321 },
322 BuiltinFn {
323 name: "array::range",
324 description: "The array::range function creates an array of numbers from a given range.",
325 signatures: &[
326 "array::range($start: int, $end: int) -> array",
327 "array::range(range) -> array;",
328 ],
329 },
330 BuiltinFn {
331 name: "array::reduce",
332 description: "The array::reduce function reduces the elements of an array to a single final value by allowing an operation to be performed at each step of the way as each subsequent item in the array is encounte...",
333 signatures: &["array::reduce(array, $operator: closure) -> value"],
334 },
335 BuiltinFn {
336 name: "array::remove",
337 description: "The array::remove function removes an item from a specific position in an array. A negative index can be provided to specify a position relative to the end of the array.",
338 signatures: &["array::remove(array, $index: number) -> array"],
339 },
340 BuiltinFn {
341 name: "array::repeat",
342 description: "The array::repeat function creates an array of a given size contain the specified value for each element.",
343 signatures: &["array::repeat(any, $count: int) -> array"],
344 },
345 BuiltinFn {
346 name: "array::reverse",
347 description: "The array::reverse function reverses the sorting order of an array.",
348 signatures: &["array::reverse(array) -> array"],
349 },
350 BuiltinFn {
351 name: "array::sequence",
352 description: "The array::sequence function creates an array of sequential integers.",
353 signatures: &[
354 "array::sequence($length: int) -> array",
355 "array::sequence($start: int, $length: int) -> array",
356 ],
357 },
358 BuiltinFn {
359 name: "array::shuffle",
360 description: "The array::shuffle function randomly shuffles the items of an array.",
361 signatures: &["array::shuffle(array) -> array"],
362 },
363 BuiltinFn {
364 name: "array::slice",
365 description: "The array::slice function returns a slice of an array, based on a starting position, and a length or negative position.",
366 signatures: &[
367 "array::slice(array, $start: int, $len: int) -> array",
368 "array::slice(array, $slice: range) -> array;",
369 ],
370 },
371 BuiltinFn {
372 name: "array::sort",
373 description: "The array::sort function sorts the values in an array in ascending or descending order.",
374 signatures: &[
375 "array::sort(array) -> array",
376 "array::sort(array, $asc: bool) -> array",
377 "array::sort(array, $order: string) -> array",
378 ],
379 },
380 BuiltinFn {
381 name: "array::sort::asc",
382 description: "The array::sort::asc function is a shorthand convenience function for the array::sort function, to sort values in an array in ascending order.",
383 signatures: &["array::sort::asc(array) -> array"],
384 },
385 BuiltinFn {
386 name: "array::sort::desc",
387 description: "The array::sort::desc function is a shorthand convenience function for the array::sort function, to sort values in an array in descending order.",
388 signatures: &["array::sort::desc(array) -> array"],
389 },
390 BuiltinFn {
391 name: "array::sort_lexical",
392 description: "The array::sort_natural_lexical function sorts the values in an array in ascending or descending order, with alphabetical strings sorted in lexical order instead of unicode list order.",
393 signatures: &[
394 "array::sort_lexical(array) -> array",
395 "array::sort_lexical(array, $asc: bool) -> array",
396 "array::sort_lexical(array, $order: string) -> array",
397 ],
398 },
399 BuiltinFn {
400 name: "array::sort_natural",
401 description: "The array::sort_natural function sorts the values in an array in ascending or descending order, with numeric strings sorted in numeric order instead of regular string order.",
402 signatures: &[
403 "array::sort_natural(array) -> array",
404 "array::sort_natural(array, $asc: bool) -> array",
405 "array::sort_natural(array, $order: string) -> array",
406 ],
407 },
408 BuiltinFn {
409 name: "array::sort_natural_lexical",
410 description: "The array::sort_natural_lexical function sorts the values in an array in ascending or descending order, while sorting numeric strings in numeric order and alphabetical strings in lexical order.",
411 signatures: &[
412 "array::sort_natural_lexical(array) -> array",
413 "array::sort_natural_lexical(array, $asc: bool) -> array",
414 "array::sort_natural_lexical(array, $order: string) -> array",
415 ],
416 },
417 BuiltinFn {
418 name: "array::swap",
419 description: "The array::swap function swaps two values of an array based on indexes.",
420 signatures: &["array::swap(array, $from: int, $to: int) -> array"],
421 },
422 BuiltinFn {
423 name: "array::transpose",
424 description: "The array::transpose function is used to perform 2d array transposition but its behavior in cases of arrays of differing sizes can be best described as taking in multiple arrays and 'layering' them...",
425 signatures: &["array::transpose(array<array>) -> array<array>"],
426 },
427 BuiltinFn {
428 name: "array::union",
429 description: "The array::union function combines two arrays together, removing duplicate values, and returning a single array.",
430 signatures: &["array::union(array, $other: array) -> array"],
431 },
432 BuiltinFn {
433 name: "array::windows",
434 description: "Built-in function array::windows",
435 signatures: &["array::windows(array, $window_size: int) -> array"],
436 },
437 BuiltinFn {
438 name: "bytes::len",
439 description: "The bytes::len function returns the length in bytes of a bytes value.",
440 signatures: &["bytes::len(bytes) -> int"],
441 },
442 BuiltinFn {
443 name: "crypto::argon2::compare",
444 description: "The crypto::argon2::compare function compares a hashed-and-salted argon2 password value with an unhashed password value.",
445 signatures: &["crypto::argon2::compare(string, $against: string) -> bool"],
446 },
447 BuiltinFn {
448 name: "crypto::argon2::generate",
449 description: "The crypto::argon2::generate function hashes and salts a password using the argon2 hashing algorithm.",
450 signatures: &["crypto::argon2::generate(string) -> string"],
451 },
452 BuiltinFn {
453 name: "crypto::bcrypt::compare",
454 description: "The crypto::bcrypt::compare function compares a hashed-and-salted bcrypt password value with an unhashed password value.",
455 signatures: &["crypto::bcrypt::compare(string, $against: string) -> bool"],
456 },
457 BuiltinFn {
458 name: "crypto::bcrypt::generate",
459 description: "The crypto::bcrypt::generate function hashes and salts a password using the bcrypt hashing algorithm.",
460 signatures: &["crypto::bcrypt::generate(string) -> string"],
461 },
462 BuiltinFn {
463 name: "crypto::blake3",
464 description: "The crypto::blake3 function returns the blake3 hash of the input value.",
465 signatures: &["crypto::blake3(string) -> string"],
466 },
467 BuiltinFn {
468 name: "crypto::joaat",
469 description: "The crypto::joaat function returns the joaat hash of the input value.",
470 signatures: &["crypto::joaat(string) -> number"],
471 },
472 BuiltinFn {
473 name: "crypto::md5",
474 description: "The crypto::md5 function returns the md5 hash of the input value.",
475 signatures: &["crypto::md5(string) -> string"],
476 },
477 BuiltinFn {
478 name: "crypto::pbkdf2::compare",
479 description: "The crypto::pbkdf2::compare function compares a hashed-and-salted pbkdf2 password value with an unhashed password value.",
480 signatures: &["crypto::pbkdf2::compare(string, $against: string) -> bool"],
481 },
482 BuiltinFn {
483 name: "crypto::pbkdf2::generate",
484 description: "The crypto::pbkdf2::generate function hashes and salts a password using the pbkdf2 hashing algorithm.",
485 signatures: &["crypto::pbkdf2::generate(string) -> string"],
486 },
487 BuiltinFn {
488 name: "crypto::scrypt::compare",
489 description: "The crypto::scrypt::compare function compares a hashed-and-salted scrypt password value with an unhashed password value.",
490 signatures: &["crypto::scrypt::compare(string, $against: string) -> bool"],
491 },
492 BuiltinFn {
493 name: "crypto::scrypt::generate",
494 description: "The crypto::scrypt::generate function hashes and salts a password using the scrypt hashing algorithm.",
495 signatures: &["crypto::scrypt::generate(string) -> string"],
496 },
497 BuiltinFn {
498 name: "crypto::sha1",
499 description: "The crypto::sha1 function returns the sha1 hash of the input value.",
500 signatures: &["crypto::sha1(string) -> string"],
501 },
502 BuiltinFn {
503 name: "crypto::sha256",
504 description: "The crypto::sha256 function returns the sha256 hash of the input value.",
505 signatures: &["crypto::sha256(string) -> string"],
506 },
507 BuiltinFn {
508 name: "crypto::sha512",
509 description: "The crypto::sha512 function returns the sha512 hash of the input value.",
510 signatures: &["crypto::sha512(string) -> string"],
511 },
512 BuiltinFn {
513 name: "duration::days",
514 description: "The duration::days function counts how many days fit into a duration.",
515 signatures: &["duration::days(duration) -> number"],
516 },
517 BuiltinFn {
518 name: "duration::from_days",
519 description: "The duration::from_days function counts how many years fit into a duration.",
520 signatures: &["duration::from_days(number) -> duration"],
521 },
522 BuiltinFn {
523 name: "duration::from_hours",
524 description: "The duration::from_hours function converts a numeric amount of hours into a duration that represents hours.",
525 signatures: &["duration::from_hours(number) -> duration"],
526 },
527 BuiltinFn {
528 name: "duration::from_micros",
529 description: "The duration::from_micros function converts a numeric amount of microseconds into a duration that represents microseconds.",
530 signatures: &["duration::from_micros(number) -> duration"],
531 },
532 BuiltinFn {
533 name: "duration::from_millis",
534 description: "The duration::from_millis function converts a numeric amount of milliseconds into a duration that represents milliseconds.",
535 signatures: &["duration::from_millis(number) -> duration"],
536 },
537 BuiltinFn {
538 name: "duration::from_mins",
539 description: "The duration::from_mins function converts a numeric amount of minutes into a duration that represents minutes.",
540 signatures: &["duration::from_mins(number) -> duration"],
541 },
542 BuiltinFn {
543 name: "duration::from_nanos",
544 description: "The duration::from_nanos function converts a numeric amount of nanoseconds into a duration that represents nanoseconds.",
545 signatures: &["duration::from_nanos(number) -> duration"],
546 },
547 BuiltinFn {
548 name: "duration::from_secs",
549 description: "The duration::from_secs function converts a numeric amount of seconds into a duration that represents seconds.",
550 signatures: &["duration::from_secs(number) -> duration"],
551 },
552 BuiltinFn {
553 name: "duration::from_weeks",
554 description: "The duration::from_weeks function converts a numeric amount of weeks into a duration that represents weeks.",
555 signatures: &["duration::from_weeks(number) -> duration"],
556 },
557 BuiltinFn {
558 name: "duration::hours",
559 description: "The duration::hours function counts how many hours fit into a duration.",
560 signatures: &["duration::hours(duration) -> number"],
561 },
562 BuiltinFn {
563 name: "duration::max",
564 description: "The duration::max constant represents the greatest possible duration that can be used.",
565 signatures: &["duration::max -> duration"],
566 },
567 BuiltinFn {
568 name: "duration::micros",
569 description: "The duration::micros function counts how many microseconds fit into a duration.",
570 signatures: &["duration::micros(duration) -> number"],
571 },
572 BuiltinFn {
573 name: "duration::millis",
574 description: "The duration::millis function counts how many milliseconds fit into a duration.",
575 signatures: &["duration::millis(duration) -> number"],
576 },
577 BuiltinFn {
578 name: "duration::mins",
579 description: "The duration::mins function counts how many minutes fit into a duration.",
580 signatures: &["duration::mins(duration) -> number"],
581 },
582 BuiltinFn {
583 name: "duration::nanos",
584 description: "The duration::nanos function counts how many nanoseconds fit into a duration.",
585 signatures: &["duration::nanos(duration) -> number"],
586 },
587 BuiltinFn {
588 name: "duration::secs",
589 description: "The duration::secs function counts how many seconds fit into a duration.",
590 signatures: &["duration::secs(duration) -> number"],
591 },
592 BuiltinFn {
593 name: "duration::weeks",
594 description: "The duration::weeks function counts how many weeks fit into a duration.",
595 signatures: &["duration::weeks(duration) -> number"],
596 },
597 BuiltinFn {
598 name: "duration::years",
599 description: "The duration::years function counts how many years fit into a duration.",
600 signatures: &["duration::years(duration) -> number"],
601 },
602 BuiltinFn {
603 name: "file::bucket",
604 description: "Built-in function file::bucket",
605 signatures: &["file::bucket(file) -> string"],
606 },
607 BuiltinFn {
608 name: "file::copy",
609 description: "The file::copy function copies the contents of a file to a new file, overwriting any existing file that has the same name as the new file.",
610 signatures: &["file::copy(string)"],
611 },
612 BuiltinFn {
613 name: "file::copy_if_not_exists",
614 description: "The file::copy_if_not_exists function copies the contents of a file to a new file, returning an error if a file already exists that has the same name as that of the intended copy.",
615 signatures: &["file::copy_if_not_exists(string)"],
616 },
617 BuiltinFn {
618 name: "file::delete",
619 description: "The file::delete function deletes a file.",
620 signatures: &["file::delete(string)"],
621 },
622 BuiltinFn {
623 name: "file::exists",
624 description: "The file::exists function checks to see if a file exists at the path and file name indicated.",
625 signatures: &["file::exists(string) -> bool"],
626 },
627 BuiltinFn {
628 name: "file::get",
629 description: "The file::get function retrieves a file for use.",
630 signatures: &["file::get(string) -> bytes"],
631 },
632 BuiltinFn {
633 name: "file::head",
634 description: "The file::head function returns the metadata for a file.",
635 signatures: &["file::head() -> object"],
636 },
637 BuiltinFn {
638 name: "file::key",
639 description: "Built-in function file::key",
640 signatures: &["file::key(file) -> string"],
641 },
642 BuiltinFn {
643 name: "file::list",
644 description: "Built-in function file::list",
645 signatures: &["file::list(string, $list_options: option<object>) -> array<object>"],
646 },
647 BuiltinFn {
648 name: "file::put",
649 description: "The file::put function adds data into a file, overwriting any existing data.",
650 signatures: &["file::put()"],
651 },
652 BuiltinFn {
653 name: "file::put_if_not_exists",
654 description: "The file::put function adds data into a file, unless a file of the same name already exists.",
655 signatures: &["file::put_if_not_exists()"],
656 },
657 BuiltinFn {
658 name: "file::rename",
659 description: "The file::rename function renames a file, overwriting any existing file that has the same name as the target name.",
660 signatures: &["file::rename()"],
661 },
662 BuiltinFn {
663 name: "file::rename_if_not_exists",
664 description: "The file::rename_if_not_exists function renames a file, returning an error if a file already exists that has the same name as the target name.",
665 signatures: &["file::rename_if_not_exists()"],
666 },
667 BuiltinFn {
668 name: "geo::area",
669 description: "The geo::area function calculates the area of a geometry in square metres.",
670 signatures: &["geo::area(geometry) -> number"],
671 },
672 BuiltinFn {
673 name: "geo::bearing",
674 description: "The geo::bearing function calculates the bearing between two geolocation points. Bearing begins at 0 degrees to indicate north, increasing clockwise into positive values and decreasing counterclock...",
675 signatures: &["geo::bearing($from: point, $to: point) -> number"],
676 },
677 BuiltinFn {
678 name: "geo::centroid",
679 description: "The geo::centroid function calculates the centroid between multiple geolocation points.",
680 signatures: &["geo::centroid(geometry) -> number"],
681 },
682 BuiltinFn {
683 name: "geo::distance",
684 description: "The geo::distance function calculates the haversine distance, in metres, between two geolocation points.",
685 signatures: &["geo::distance($from: point, $to: point) -> number"],
686 },
687 BuiltinFn {
688 name: "geo::hash::decode",
689 description: "The geo::hash::decode function converts a geohash into a geolocation point.",
690 signatures: &["geo::hash::decode(point) -> string"],
691 },
692 BuiltinFn {
693 name: "geo::hash::encode",
694 description: "The geo::hash::encode function converts a geolocation point into a geohash.",
695 signatures: &[
696 "geo::hash::encode(point) -> string",
697 "geo::hash::encode(point, $granularity: number) -> string",
698 ],
699 },
700 BuiltinFn {
701 name: "geo::is_valid",
702 description: "The geo::is_valid function determines if a geometry type is a geography type. Geography types are used to store geolocation data in a Geographic Coordinate System (GCS), whereas geometry types can ...",
703 signatures: &["geo::is_valid(geometry) -> bool"],
704 },
705 BuiltinFn {
706 name: "http::delete",
707 description: "The http::delete function performs a remote HTTP DELETE request. The first parameter is the URL of the remote endpoint, and the second parameter is the value to use as the request body, which will ...",
708 signatures: &[
709 "http::delete(string) -> value",
710 "http::delete(string, $headers: object) -> value",
711 ],
712 },
713 BuiltinFn {
714 name: "http::get",
715 description: "The http::get function performs a remote HTTP GET request. The first parameter is the URL of the remote endpoint. If the response does not return a 2XX status code, then the function will fail and ...",
716 signatures: &[
717 "http::get(string) -> value",
718 "http::get(string, $headers: object) -> value",
719 ],
720 },
721 BuiltinFn {
722 name: "http::head",
723 description: "The http::head function performs a remote HTTP HEAD request. The first parameter is the URL of the remote endpoint. If the response does not return a 2XX status code, then the function will fail an...",
724 signatures: &[
725 "http::head(string) -> null",
726 "http::head(string, $headers: object) -> null",
727 ],
728 },
729 BuiltinFn {
730 name: "http::patch",
731 description: "The http::patch function performs a remote HTTP PATCH request. The first parameter is the URL of the remote endpoint, and the second parameter is the value to use as the request body, which will be...",
732 signatures: &[
733 "http::patch(string, $body: object) -> value",
734 "http::patch(string, $body: object, $headers: object) -> value",
735 ],
736 },
737 BuiltinFn {
738 name: "http::post",
739 description: "The http::post function performs a remote HTTP POST request. The first parameter is the URL of the remote endpoint, and the second parameter is the value to use as the request body, which will be c...",
740 signatures: &[
741 "http::post(string, $body: object) -> value",
742 "http::post(string, $body: object, $headers: object) -> value",
743 ],
744 },
745 BuiltinFn {
746 name: "http::put",
747 description: "The http::put function performs a remote HTTP PUT request. The first parameter is the URL of the remote endpoint, and the second parameter is the value to use as the request body, which will be con...",
748 signatures: &[
749 "http::put(string, $body: object) -> value",
750 "http::put(string, $body: object, $headers: object) -> value",
751 ],
752 },
753 BuiltinFn {
754 name: "math::abs",
755 description: "The math::abs function returns the absolute value of a number.",
756 signatures: &["math::abs(number) -> number"],
757 },
758 BuiltinFn {
759 name: "math::acos",
760 description: "The math::acos function returns the arccosine (inverse cosine) of a number, which must be in the range -1 to 1. The result is expressed in radians.",
761 signatures: &["math::acos(number) -> number"],
762 },
763 BuiltinFn {
764 name: "math::acot",
765 description: "The math::acot function returns the arccotangent (inverse cotangent) of a number. The result is expressed in radians.",
766 signatures: &["math::acot(number) -> number"],
767 },
768 BuiltinFn {
769 name: "math::asin",
770 description: "The math::asin function returns the arcsine (inverse sine) of a number, which must be in the range -1 to 1. The result is expressed in radians.",
771 signatures: &["math::asin(number) -> number"],
772 },
773 BuiltinFn {
774 name: "math::atan",
775 description: "The math::atan function returns the arctangent (inverse tangent) of a number. The result is expressed in radians.",
776 signatures: &["math::atan(number) -> number"],
777 },
778 BuiltinFn {
779 name: "math::bottom",
780 description: "The math::bottom function returns the bottom X set of numbers in an array of numbers.",
781 signatures: &["math::bottom(array<number>, $quantity: number) -> number"],
782 },
783 BuiltinFn {
784 name: "math::ceil",
785 description: "The math::ceil function rounds a number up to the next largest whole number.",
786 signatures: &["math::ceil(number) -> number"],
787 },
788 BuiltinFn {
789 name: "math::clamp",
790 description: "The math::clamp function constrains a number within the specified range, defined by a minimum and a maximum value. If the number is less than the minimum, it returns the minimum. If it is greater t...",
791 signatures: &["math::clamp(number, $min: number, $max: number) -> number"],
792 },
793 BuiltinFn {
794 name: "math::cos",
795 description: "The math::cos function returns the cosine of a number, which is assumed to be in radians. The result is a value between -1 and 1.",
796 signatures: &["math::cos(number) -> number"],
797 },
798 BuiltinFn {
799 name: "math::cot",
800 description: "The math::cot function returns the cotangent of a number, which is assumed to be in radians. The cotangent is the reciprocal of the tangent function.",
801 signatures: &["math::cot(number) -> number"],
802 },
803 BuiltinFn {
804 name: "math::deg2rad",
805 description: "The math::deg2rad function converts an angle from degrees to radians.",
806 signatures: &["math::deg2rad(number) -> number"],
807 },
808 BuiltinFn {
809 name: "math::e",
810 description: "The math::e constant represents the base of the natural logarithm (Euler’s number).",
811 signatures: &["math::e -> number"],
812 },
813 BuiltinFn {
814 name: "math::fixed",
815 description: "The math::fixed function returns a number with the specified number of decimal places.",
816 signatures: &["math::fixed(number, $places: number) -> number"],
817 },
818 BuiltinFn {
819 name: "math::floor",
820 description: "The math::floor function rounds a number down to the nearest integer.",
821 signatures: &["math::floor(number) -> number"],
822 },
823 BuiltinFn {
824 name: "math::frac_1_pi",
825 description: "The math::frac_1_pi constant represents the fraction 1/π.",
826 signatures: &["math::frac_1_pi -> number"],
827 },
828 BuiltinFn {
829 name: "math::frac_1_sqrt_2",
830 description: "The math::frac_1_sqrt_2 constant represents the fraction 1/sqrt(2).",
831 signatures: &["math::frac_1_sqrt_2 -> number"],
832 },
833 BuiltinFn {
834 name: "math::frac_2_pi",
835 description: "The math::frac_2_pi constant represents the fraction 2/π.",
836 signatures: &["math::frac_2_pi -> number"],
837 },
838 BuiltinFn {
839 name: "math::frac_2_sqrt_pi",
840 description: "The math::frac_2_sqrt_pi constant represents the fraction 2/sqrt(π).",
841 signatures: &["math::frac_2_sqrt_pi -> number"],
842 },
843 BuiltinFn {
844 name: "math::frac_pi_2",
845 description: "The math::frac_pi_2 constant represents the fraction π/2.",
846 signatures: &["math::frac_pi_2 -> number"],
847 },
848 BuiltinFn {
849 name: "math::frac_pi_3",
850 description: "The math::frac_pi_3 constant represents the fraction π/3.",
851 signatures: &["math::frac_pi_3 -> number"],
852 },
853 BuiltinFn {
854 name: "math::frac_pi_4",
855 description: "The math::frac_pi_4 constant represents the fraction π/4.",
856 signatures: &["math::frac_pi_4 -> number"],
857 },
858 BuiltinFn {
859 name: "math::frac_pi_6",
860 description: "The math::frac_pi_6 constant represents the fraction π/6.",
861 signatures: &["math::frac_pi_6 -> number"],
862 },
863 BuiltinFn {
864 name: "math::frac_pi_8",
865 description: "The math::frac_pi_8 constant represents the fraction π/8.",
866 signatures: &["math::frac_pi_8 -> number"],
867 },
868 BuiltinFn {
869 name: "math::inf",
870 description: "The math::inf constant represents positive infinity.",
871 signatures: &["math::inf -> number"],
872 },
873 BuiltinFn {
874 name: "math::interquartile",
875 description: "The math::interquartile function returns the interquartile of an array of numbers.",
876 signatures: &["math::interquartile(array<number>) -> number"],
877 },
878 BuiltinFn {
879 name: "math::lerp",
880 description: "The math::lerp function performs a linear interpolation between two numbers based on a given fraction. The fraction will usually be between 0 and 1, where 0 returns $num_1 and 1 returns $num_2.",
881 signatures: &["math::lerp($num_1: number, $num_2: number, $fraction: number) -> number"],
882 },
883 BuiltinFn {
884 name: "math::lerpangle",
885 description: "The math::lerpangle function interpolates between two angles ($num_1 and $num_2) by the given fraction. This is useful for smoothly transitioning between angles.",
886 signatures: &[
887 "math::lerpangle($num_1: number, $num_2: number, $fraction: number) -> number",
888 ],
889 },
890 BuiltinFn {
891 name: "math::ln",
892 description: "The math::ln function returns the natural logarithm (base e) of a number.",
893 signatures: &["math::ln(number) -> number"],
894 },
895 BuiltinFn {
896 name: "math::ln_10",
897 description: "The math::ln_10 constant represents the natural logarithm (base e) of 10.",
898 signatures: &["math::ln_10 -> number"],
899 },
900 BuiltinFn {
901 name: "math::ln_2",
902 description: "The math::ln_2 constant represents the natural logarithm (base e) of 2.",
903 signatures: &["math::ln_2 -> number"],
904 },
905 BuiltinFn {
906 name: "math::log",
907 description: "The math::log function returns the logarithm of a number with a specified base.",
908 signatures: &["math::log(number, $base: number) -> number"],
909 },
910 BuiltinFn {
911 name: "math::log10",
912 description: "The math::log10 function returns the base-10 logarithm of a number.",
913 signatures: &["math::log10(number) -> number"],
914 },
915 BuiltinFn {
916 name: "math::log10_2",
917 description: "The math::log10_2 constant represents the base-10 logarithm of 2.",
918 signatures: &["math::log10_2 -> number"],
919 },
920 BuiltinFn {
921 name: "math::log10_e",
922 description: "The math::log10_e constant represents the base-10 logarithm of e, the base of the natural logarithm (Euler’s number).",
923 signatures: &["math::log10_e -> number"],
924 },
925 BuiltinFn {
926 name: "math::log2",
927 description: "The math::log2 function returns the base-2 logarithm of a number.",
928 signatures: &["math::log2(number) -> number"],
929 },
930 BuiltinFn {
931 name: "math::log2_10",
932 description: "The math::log2_10 constant represents the base-2 logarithm of 10.",
933 signatures: &["math::log2_10 -> number"],
934 },
935 BuiltinFn {
936 name: "math::log2_e",
937 description: "The math::log2_e constant represents the base-2 logarithm of e, the base of the natural logarithm (Euler’s number).",
938 signatures: &["math::log2_e -> number"],
939 },
940 BuiltinFn {
941 name: "math::max",
942 description: "The math::max function returns the greatest number from an array of numbers.",
943 signatures: &["math::max(array<number>) -> number"],
944 },
945 BuiltinFn {
946 name: "math::mean",
947 description: "The math::mean function returns the mean of a set of numbers.",
948 signatures: &["math::mean(array<number>) -> number"],
949 },
950 BuiltinFn {
951 name: "math::median",
952 description: "The math::median function returns the median of a set of numbers.",
953 signatures: &["math::median(array<number>) -> number"],
954 },
955 BuiltinFn {
956 name: "math::midhinge",
957 description: "The math::midhinge function returns the midhinge of an array of numbers.",
958 signatures: &["math::midhinge(array<number>) -> number"],
959 },
960 BuiltinFn {
961 name: "math::min",
962 description: "The math::min function returns the least number from an array of numbers.",
963 signatures: &["math::min(array<number>) -> number"],
964 },
965 BuiltinFn {
966 name: "math::mode",
967 description: "The math::mode function returns the value that occurs most often in a set of numbers. In case of a tie, the highest one is returned.",
968 signatures: &["math::mode(array<number>) -> number"],
969 },
970 BuiltinFn {
971 name: "math::nearestrank",
972 description: "The math::nearestrank function returns the nearest rank of an array of numbers by pullinng the closest extant record from the dataset at the %-th percentile.",
973 signatures: &["math::nearestrank(array<number>, $percentile: number) -> number"],
974 },
975 BuiltinFn {
976 name: "math::neg_inf",
977 description: "The math::neg_inf constant represents negative infinity.",
978 signatures: &["math::neg_inf -> number"],
979 },
980 BuiltinFn {
981 name: "math::percentile",
982 description: "The math::percentile function returns the value below which a percentage of data falls by getting the N percentile, averaging neighboring records if non-exact.",
983 signatures: &["math::percentile(array<number>, $percentile: number) -> number"],
984 },
985 BuiltinFn {
986 name: "math::pi",
987 description: "The math::pi constant represents the mathematical constant π.",
988 signatures: &["math::pi -> number"],
989 },
990 BuiltinFn {
991 name: "math::pow",
992 description: "The math::pow function returns a number raised to the power of a second number.",
993 signatures: &["math::pow(number, $raise_to: number) -> number"],
994 },
995 BuiltinFn {
996 name: "math::product",
997 description: "The math::product function returns the product of a set of numbers.",
998 signatures: &["math::product(array<number>) -> number"],
999 },
1000 BuiltinFn {
1001 name: "math::rad2deg",
1002 description: "The math::rad2deg function converts an angle from radians to degrees.",
1003 signatures: &["math::rad2deg(number) -> number"],
1004 },
1005 BuiltinFn {
1006 name: "math::round",
1007 description: "The math::round function rounds a number up or down to the nearest integer.",
1008 signatures: &["math::round(number) -> number"],
1009 },
1010 BuiltinFn {
1011 name: "math::sign",
1012 description: "The math::sign function returns the sign of a number, indicating whether the number is positive, negative, or zero. It returns 1 for positive numbers, -1 for negative numbers, and 0 for zero.",
1013 signatures: &["math::sign(number) -> number"],
1014 },
1015 BuiltinFn {
1016 name: "math::sin",
1017 description: "The math::sin function returns the sine of a number, which is assumed to be in radians.",
1018 signatures: &["math::sin(number) -> number"],
1019 },
1020 BuiltinFn {
1021 name: "math::spread",
1022 description: "The math::spread function returns the spread of an array of numbers.",
1023 signatures: &["math::spread(array<number>) -> number"],
1024 },
1025 BuiltinFn {
1026 name: "math::sqrt",
1027 description: "The math::sqrt function returns the square root of a number.",
1028 signatures: &["math::sqrt(number) -> number"],
1029 },
1030 BuiltinFn {
1031 name: "math::sqrt_2",
1032 description: "The math::sqrt_2 constant represents the square root of 2.",
1033 signatures: &["math::sqrt_2 -> number"],
1034 },
1035 BuiltinFn {
1036 name: "math::stddev",
1037 description: "The math::stddev function calculates how far a set of numbers are away from the mean.",
1038 signatures: &["math::stddev(array<number>) -> number"],
1039 },
1040 BuiltinFn {
1041 name: "math::sum",
1042 description: "The math::sum function returns the total sum of a set of numbers.",
1043 signatures: &["math::sum(array<number>) -> number"],
1044 },
1045 BuiltinFn {
1046 name: "math::tan",
1047 description: "The math::tan function returns the tangent of a number, which is assumed to be in radians.",
1048 signatures: &["math::tan(number) -> number"],
1049 },
1050 BuiltinFn {
1051 name: "math::tau",
1052 description: "The math::tau constant represents the mathematical constant τ, which is equal to 2π.",
1053 signatures: &["math::tau -> number"],
1054 },
1055 BuiltinFn {
1056 name: "math::top",
1057 description: "The math::top function returns the top of an array of numbers.",
1058 signatures: &["math::top(array<number>, $quantity: number) -> number"],
1059 },
1060 BuiltinFn {
1061 name: "math::trimean",
1062 description: "The math::trimean function returns the trimean of an array of numbers.",
1063 signatures: &["math::trimean(array<number>) -> number"],
1064 },
1065 BuiltinFn {
1066 name: "math::variance",
1067 description: "The math::variance function returns the variance of an array of numbers.",
1068 signatures: &["math::variance(array<number>) -> number"],
1069 },
1070 BuiltinFn {
1071 name: "meta::id",
1072 description: "The meta::id function extracts and returns the identifier from a SurrealDB Record ID.",
1073 signatures: &["meta::id(record) -> value"],
1074 },
1075 BuiltinFn {
1076 name: "meta::tb",
1077 description: "The meta::tb function extracts and returns the table name from a SurrealDB Record ID.",
1078 signatures: &["meta::tb(record) -> string"],
1079 },
1080 BuiltinFn {
1081 name: "object::entries",
1082 description: "The object::entries function transforms an object into an array with arrays of key-value combinations.",
1083 signatures: &["object::entries(object) -> array"],
1084 },
1085 BuiltinFn {
1086 name: "object::extend",
1087 description: "The object::extend function extends an object with the fields and values of another one, essentially adding the two together.",
1088 signatures: &["object::extend(object, $other: object) -> object"],
1089 },
1090 BuiltinFn {
1091 name: "object::from_entries",
1092 description: "The object::from_entries function transforms an array with arrays of key-value combinations into an object.",
1093 signatures: &["object::from_entries(array) -> object"],
1094 },
1095 BuiltinFn {
1096 name: "object::is_empty",
1097 description: "The object::is_empty function checks whether the object contains values.",
1098 signatures: &["object::is_empty(object) -> bool"],
1099 },
1100 BuiltinFn {
1101 name: "object::keys",
1102 description: "The object::keys function returns an array with all the keys of an object.",
1103 signatures: &["object::keys(object) -> array"],
1104 },
1105 BuiltinFn {
1106 name: "object::len",
1107 description: "The object::len function returns the amount of key-value pairs an object holds.",
1108 signatures: &["object::len(object) -> number"],
1109 },
1110 BuiltinFn {
1111 name: "object::remove",
1112 description: "The object::remove function removes one or more fields from an object.",
1113 signatures: &["object::remove(object, $to_remove: string|array<string>) -> object"],
1114 },
1115 BuiltinFn {
1116 name: "object::values",
1117 description: "The object::values function returns an array with all the values of an object.",
1118 signatures: &["object::values(object) -> array"],
1119 },
1120 BuiltinFn {
1121 name: "parse::email::host",
1122 description: "The parse::email::host function parses and returns an email host from a valid email address.",
1123 signatures: &["parse::email::host(string) -> string"],
1124 },
1125 BuiltinFn {
1126 name: "parse::email::user",
1127 description: "The parse::email::user function parses and returns an email username from a valid email address.",
1128 signatures: &["parse::email::user(string) -> string"],
1129 },
1130 BuiltinFn {
1131 name: "parse::url::domain",
1132 description: "The parse::url::domain function parses and returns domain from a valid URL. This function is similar to parse::url::host only that it will return null if the URL is an IP address.",
1133 signatures: &["parse::url::domain(string) -> string"],
1134 },
1135 BuiltinFn {
1136 name: "parse::url::fragment",
1137 description: "The parse::url::fragment function parses and returns the fragment from a valid URL.",
1138 signatures: &["parse::url::fragment(string) -> string"],
1139 },
1140 BuiltinFn {
1141 name: "parse::url::host",
1142 description: "The parse::url::host function parses and returns the hostname from a valid URL.",
1143 signatures: &["parse::url::host(string) -> string"],
1144 },
1145 BuiltinFn {
1146 name: "parse::url::path",
1147 description: "The parse::url::path function parses and returns the path from a valid URL.",
1148 signatures: &["parse::url::path(string) -> string"],
1149 },
1150 BuiltinFn {
1151 name: "parse::url::port",
1152 description: "The parse::url::port function parses and returns the port from a valid URL.",
1153 signatures: &["parse::url::port(string) -> number"],
1154 },
1155 BuiltinFn {
1156 name: "parse::url::query",
1157 description: "The parse::url::query function parses and returns the query from a valid URL.",
1158 signatures: &["parse::url::query(string) -> string"],
1159 },
1160 BuiltinFn {
1161 name: "parse::url::scheme",
1162 description: "The parse::url::scheme function parses and returns the scheme from a valid URL, in lowercase, as an ASCII string without the ':' delimiter.",
1163 signatures: &["parse::url::scheme(string) -> string"],
1164 },
1165 BuiltinFn {
1166 name: "rand::bool",
1167 description: "The rand::bool function generates a random boolean value.",
1168 signatures: &["rand::bool() -> bool"],
1169 },
1170 BuiltinFn {
1171 name: "rand::duration",
1172 description: "The rand::duration function generates a random duration value between two duration arguments.",
1173 signatures: &["rand::bool($from: duration, $to: duration) -> duration"],
1174 },
1175 BuiltinFn {
1176 name: "rand::enum",
1177 description: "The rand::enum function generates a random value, from a multitude of values.",
1178 signatures: &[
1179 "rand::enum(value...) -> any",
1180 "rand::enum(array<value>) -> any",
1181 ],
1182 },
1183 BuiltinFn {
1184 name: "rand::float",
1185 description: "The rand::float function generates a random float, between 0 and 1.",
1186 signatures: &[
1187 "rand::float() -> float",
1188 "rand::float($from: number, $to: number) -> float",
1189 ],
1190 },
1191 BuiltinFn {
1192 name: "rand::id",
1193 description: "> [!NOTE] > This function was known as rand::guid in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1194 signatures: &[
1195 "rand::id() -> string",
1196 "rand::id(number) -> string",
1197 "rand::id($min_len: int, $max_len: int) -> string",
1198 ],
1199 },
1200 BuiltinFn {
1201 name: "rand::int",
1202 description: "The rand::int function generates a random int.",
1203 signatures: &[
1204 "rand::int() -> int",
1205 "rand::int($from: int, $to: int) -> int",
1206 ],
1207 },
1208 BuiltinFn {
1209 name: "rand::string",
1210 description: "The rand::string function generates a random string, with 32 characters.",
1211 signatures: &[
1212 "rand::string() -> string",
1213 "rand::string(number) -> string",
1214 "rand::string($from: int, $to: int) -> string",
1215 ],
1216 },
1217 BuiltinFn {
1218 name: "rand::time",
1219 description: "The rand::time function generates a random datetime.",
1220 signatures: &[
1221 "rand::time() -> datetime",
1222 "rand::time($from: datetime|number, $to: datetime|number) -> datetime",
1223 ],
1224 },
1225 BuiltinFn {
1226 name: "rand::ulid",
1227 description: "The rand::ulid function generates a random ULID.",
1228 signatures: &["rand::ulid() -> uuid", "rand::ulid(datetime) -> uuid"],
1229 },
1230 BuiltinFn {
1231 name: "rand::uuid",
1232 description: "The rand::uuid function generates a random Version 7 UUID.",
1233 signatures: &["rand::uuid() -> uuid", "rand::uuid(datetime) -> uuid"],
1234 },
1235 BuiltinFn {
1236 name: "rand::uuid::v4",
1237 description: "The rand::uuid::v4 function generates a random version 4 UUID.",
1238 signatures: &["rand::uuid::v4() -> uuid"],
1239 },
1240 BuiltinFn {
1241 name: "record::exists",
1242 description: "The record::exists function checks to see if a given record exists.",
1243 signatures: &["record::exists(record) -> bool"],
1244 },
1245 BuiltinFn {
1246 name: "record::id",
1247 description: "The record::id function extracts and returns the identifier from a SurrealDB Record ID.",
1248 signatures: &["record::id(record) -> value"],
1249 },
1250 BuiltinFn {
1251 name: "record::is_edge",
1252 description: "The record::is_edge function checks to see if the value passed in is a graph edge.",
1253 signatures: &["record::is_edge(record | string) -> bool"],
1254 },
1255 BuiltinFn {
1256 name: "record::tb",
1257 description: "The record::tb function extracts and returns the table name from a SurrealDB Record ID.",
1258 signatures: &["record::tb(record) -> string"],
1259 },
1260 BuiltinFn {
1261 name: "search::analyze",
1262 description: "The search_analyze function returns the outut of a defined search analyzer on an input string.",
1263 signatures: &["search::analyze($analyzer: string, $input: string) -> array<string>"],
1264 },
1265 BuiltinFn {
1266 name: "search::highlight",
1267 description: "The search::highlight function highlights the matching keywords for the predicate reference number.",
1268 signatures: &[
1269 "search::highlight($prepend: string, $append: string, $predicate: number, $highlight_all: option<bool>) -> string | string[]",
1270 ],
1271 },
1272 BuiltinFn {
1273 name: "search::linear",
1274 description: "Built-in function search::linear",
1275 signatures: &[
1276 "search::linear($lists: array, $weights: array, $limit: int, $norm: 'minmax' | 'zscore') -> array<object>",
1277 ],
1278 },
1279 BuiltinFn {
1280 name: "search::offsets",
1281 description: "The search::offsets function returns the position of the matching keywords for the predicate reference number.",
1282 signatures: &[
1283 "search::offsets($predicate: number, $highlight_all: option<bool>) -> object",
1284 ],
1285 },
1286 BuiltinFn {
1287 name: "search::rrf",
1288 description: "Built-in function search::rrf",
1289 signatures: &["search::rrf($lists: array, $limit: int, $k: option<int>) -> array<object>"],
1290 },
1291 BuiltinFn {
1292 name: "search::score",
1293 description: "The search::score function returns the relevance score corresponding to the given 'matches' predicate reference numbers.",
1294 signatures: &["search::score(number) -> number"],
1295 },
1296 BuiltinFn {
1297 name: "sequence::next",
1298 description: "The sequence::next function returns the next value in a sequence.",
1299 signatures: &["sequence::next($seq_name: string) -> int"],
1300 },
1301 BuiltinFn {
1302 name: "session::ac",
1303 description: "> [!NOTE] > This function was known as session::sc in versions of SurrrealDB before 2.0. The behaviour has not changed.",
1304 signatures: &["session::ac() -> string"],
1305 },
1306 BuiltinFn {
1307 name: "session::db",
1308 description: "The session::db function returns the currently selected database.",
1309 signatures: &["session::db() -> string"],
1310 },
1311 BuiltinFn {
1312 name: "session::id",
1313 description: "The session::id function returns the current user's session ID.",
1314 signatures: &["session::id() -> string"],
1315 },
1316 BuiltinFn {
1317 name: "session::ip",
1318 description: "The session::ip function returns the current user's session IP address.",
1319 signatures: &["session::ip() -> string"],
1320 },
1321 BuiltinFn {
1322 name: "session::ns",
1323 description: "The session::ns function returns the currently selected namespace.",
1324 signatures: &["session::ns() -> string"],
1325 },
1326 BuiltinFn {
1327 name: "session::origin",
1328 description: "The session::origin function returns the current user's HTTP origin.",
1329 signatures: &["session::origin() -> string"],
1330 },
1331 BuiltinFn {
1332 name: "session::rd",
1333 description: "The session::rd function returns the current user's record authentication.",
1334 signatures: &["session::rd() -> string"],
1335 },
1336 BuiltinFn {
1337 name: "session::token",
1338 description: "The session::token function returns the current authentication token.",
1339 signatures: &["session::token() -> string"],
1340 },
1341 BuiltinFn {
1342 name: "set::add",
1343 description: "The set::add function adds an item to a set only if it does not already exist.",
1344 signatures: &["set::add(set, $new_val: value) -> set"],
1345 },
1346 BuiltinFn {
1347 name: "set::all",
1348 description: "When called on a set without any extra arguments, the set::all function checks whether all set values are truthy.",
1349 signatures: &[
1350 "set::all(set) -> bool",
1351 "set::all(set, $predicate: value) -> bool",
1352 "set::all(set, $predicate: closure) -> bool",
1353 ],
1354 },
1355 BuiltinFn {
1356 name: "set::any",
1357 description: "The set::any function checks whether any set values are truthy.",
1358 signatures: &[
1359 "set::any(set) -> bool",
1360 "set::any(set, $predicate: value) -> bool",
1361 "set::any(set, $predicate: closure) -> bool",
1362 ],
1363 },
1364 BuiltinFn {
1365 name: "set::at",
1366 description: "The set::at function returns the value at the specified only, or in reverse for a negative index.",
1367 signatures: &["set::at(set, $index: int) -> any"],
1368 },
1369 BuiltinFn {
1370 name: "set::complement",
1371 description: "The set::complement function returns the complement of two sets, namely a single set containing items that are in the first set but not in the second set.",
1372 signatures: &["set::complement(set, $other: set) -> set"],
1373 },
1374 BuiltinFn {
1375 name: "set::contains",
1376 description: "The set::contains function checks to see if a value is contained within a set.",
1377 signatures: &["set::contains(set, $other: value) -> bool"],
1378 },
1379 BuiltinFn {
1380 name: "set::difference",
1381 description: "The set::difference function determines the symmetric difference between two sets, returning a single set containing items that are not shared between them.",
1382 signatures: &["set::difference(set, $other: set) -> set"],
1383 },
1384 BuiltinFn {
1385 name: "set::filter",
1386 description: "The set::filter function filters out values that do not match a pattern.",
1387 signatures: &[
1388 "set::filter(set, $predicate: value) -> set",
1389 "set::filter(set, $predicate: closure) -> set",
1390 ],
1391 },
1392 BuiltinFn {
1393 name: "set::find",
1394 description: "The set::find function returns the first matching value from a set.",
1395 signatures: &[
1396 "set::find(set, $predicate: value) -> value | NONE",
1397 "set::find(set, $predicate: closure) -> value | NONE",
1398 ],
1399 },
1400 BuiltinFn {
1401 name: "set::first",
1402 description: "The set::first function returns the first value from a set.",
1403 signatures: &["set::first(set) -> any"],
1404 },
1405 BuiltinFn {
1406 name: "set::flatten",
1407 description: "The set::flatten function flattens nested sets and arrays into a single set.",
1408 signatures: &["set::flatten(set) -> set"],
1409 },
1410 BuiltinFn {
1411 name: "set::fold",
1412 description: "The set::fold function applies an operation on an initial value and every element in the set, returning the final result.",
1413 signatures: &["set::fold(set, $initial: value, $operator: closure) -> value"],
1414 },
1415 BuiltinFn {
1416 name: "set::intersect",
1417 description: "The set::intersect function calculates the values which intersect two sets, returning a single set containing the values which are in both sets.",
1418 signatures: &["set::intersect(set, $other: set) -> set"],
1419 },
1420 BuiltinFn {
1421 name: "set::is_empty",
1422 description: "The set::is_empty function checks whether the set is empty or not.",
1423 signatures: &["set::is_empty(set) -> bool"],
1424 },
1425 BuiltinFn {
1426 name: "set::join",
1427 description: "The set::join function joins all values in a set together into a string, with a string separator in between each value.",
1428 signatures: &["set::join(set, $separator: string) -> string"],
1429 },
1430 BuiltinFn {
1431 name: "set::last",
1432 description: "The set::last function returns the last value from a set.",
1433 signatures: &["set::last(set) -> any"],
1434 },
1435 BuiltinFn {
1436 name: "set::len",
1437 description: "The set::len function calculates the length of a set, returning a number. This function counts unique items only.",
1438 signatures: &["set::len(set) -> number"],
1439 },
1440 BuiltinFn {
1441 name: "set::map",
1442 description: "The set::map function allows the user to call an anonymous function (closure) that is performed on every item in the set before passing it on.",
1443 signatures: &["set::map(set, $operator: closure) -> set"],
1444 },
1445 BuiltinFn {
1446 name: "set::max",
1447 description: "The set::max function returns the greatest value from a set of values.",
1448 signatures: &["set::max(set) -> any"],
1449 },
1450 BuiltinFn {
1451 name: "set::min",
1452 description: "The set::min function returns the least value from a set of values.",
1453 signatures: &["set::min(set) -> any"],
1454 },
1455 BuiltinFn {
1456 name: "set::reduce",
1457 description: "The set::reduce function applies an operation on every element in the set, returning the final result.",
1458 signatures: &["set::reduce(set, $operator: closure) -> value"],
1459 },
1460 BuiltinFn {
1461 name: "set::remove",
1462 description: "The set::remove function removes a value from a set.",
1463 signatures: &["set::remove(set, $remove: value) -> set"],
1464 },
1465 BuiltinFn {
1466 name: "set::slice",
1467 description: "The set::slice function returns a slice of a set by position.",
1468 signatures: &[
1469 "set::slice(set) -> set",
1470 "set::slice(set, $start: int) -> set",
1471 "set::slice(set, $start: int, $end: int) -> set",
1472 "set::slice(set, $range: range<int>) -> set",
1473 ],
1474 },
1475 BuiltinFn {
1476 name: "set::union",
1477 description: "The set::union function combines two sets together, removing duplicate values, and returning a single set.",
1478 signatures: &["set::union(set, $other: set) -> set"],
1479 },
1480 BuiltinFn {
1481 name: "string::capitalize",
1482 description: "The string::capitalize function capitalizes the first letter of each word in a string.",
1483 signatures: &["string::capitalize(string) -> string"],
1484 },
1485 BuiltinFn {
1486 name: "string::concat",
1487 description: "The string::concat function concatenates values together into a single string.",
1488 signatures: &["string::concat(value, ...) -> string"],
1489 },
1490 BuiltinFn {
1491 name: "string::contains",
1492 description: "The string::contains function checks whether a string contains another string.",
1493 signatures: &["string::contains(string, $predicate: string) -> bool"],
1494 },
1495 BuiltinFn {
1496 name: "string::distance::damerau_levenshtein",
1497 description: "The string::distance::damerau_levenshtein function returns the Damerau-Levenshtein distance between two strings.",
1498 signatures: &["string::distance::damerau_levenshtein(string, string) -> int"],
1499 },
1500 BuiltinFn {
1501 name: "string::distance::hamming",
1502 description: "The string::distance::hamming function returns the Hamming distance between two strings of equal length.",
1503 signatures: &["string::distance::hamming(string, string) -> int"],
1504 },
1505 BuiltinFn {
1506 name: "string::distance::levenshtein",
1507 description: "The string::distance::levenshtein function returns the Levenshtein distance between two strings.",
1508 signatures: &["string::distance::levenshtein(string, string) -> int"],
1509 },
1510 BuiltinFn {
1511 name: "string::distance::normalized_damerau_levenshtein",
1512 description: "The string::distance::normalized_damerau_levenshtein function returns the normalized Damerau-Levenshtein distance between two strings. Normalized means that identical strings will return a score of...",
1513 signatures: &["string::distance::normalized_damerau_levenshtein(string, string) -> float"],
1514 },
1515 BuiltinFn {
1516 name: "string::distance::normalized_levenshtein",
1517 description: "The string::distance::normalized_levenshtein function returns the normalized Levenshtein distance between two strings. Normalized means that identical strings will return a score of 1, with less si...",
1518 signatures: &["string::distance::normalized_levenshtein(string, string) -> float"],
1519 },
1520 BuiltinFn {
1521 name: "string::distance::osa",
1522 description: "> [!NOTE] > This function was known as string::distance::osa_distance in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1523 signatures: &["string::distance::normalized_levenshtein(string, string) -> int"],
1524 },
1525 BuiltinFn {
1526 name: "string::ends_with",
1527 description: "> [!NOTE] > This function was known as string::endsWith in versions of SurrrealDB before 2.0. The behaviour has not changed.",
1528 signatures: &["string::ends_with(string, $other: string) -> bool"],
1529 },
1530 BuiltinFn {
1531 name: "string::html::encode",
1532 description: "The string::html::encode function encodes special characters into HTML entities to prevent HTML injection. It is recommended to use this function in most cases when retrieving any untrusted content...",
1533 signatures: &["string::html::encode(string) -> string"],
1534 },
1535 BuiltinFn {
1536 name: "string::html::sanitize",
1537 description: "The string::html::sanitize function sanitizes HTML code to prevent the most dangerous subset of HTML injection that can lead to attacks like cross-site scripting, layout breaking or clickjacking. T...",
1538 signatures: &["string::html::sanitize(string) -> string"],
1539 },
1540 BuiltinFn {
1541 name: "string::is_alpha",
1542 description: "> [!NOTE] > This function was known as string::is::alpha in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1543 signatures: &["string::is_alpha(string) -> bool"],
1544 },
1545 BuiltinFn {
1546 name: "string::is_alphanum",
1547 description: "> [!NOTE] > This function was known as string::is::alphanum in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1548 signatures: &["string::is_alphanum(string) -> bool"],
1549 },
1550 BuiltinFn {
1551 name: "string::is_ascii",
1552 description: "> [!NOTE] > This function was known as string::is::ascii in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1553 signatures: &["string::is_ascii(string) -> bool"],
1554 },
1555 BuiltinFn {
1556 name: "string::is_datetime",
1557 description: "> [!NOTE] > This function was known as string::is::datetime in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1558 signatures: &["string::is_datetime(string, $format: option<string>) -> bool"],
1559 },
1560 BuiltinFn {
1561 name: "string::is_domain",
1562 description: "> [!NOTE] > This function was known as string::is::domain in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1563 signatures: &["string::is_domain(string) -> bool"],
1564 },
1565 BuiltinFn {
1566 name: "string::is_email",
1567 description: "> [!NOTE] > This function was known as string::is::email in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1568 signatures: &["string::is_email(string) -> bool"],
1569 },
1570 BuiltinFn {
1571 name: "string::is_hexadecimal",
1572 description: "> [!NOTE] > This function was known as string::is::hexadecimal in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1573 signatures: &["string::is_hexadecimal(string) -> bool"],
1574 },
1575 BuiltinFn {
1576 name: "string::is_ip",
1577 description: "> [!NOTE] > This function was known as string::is::ip in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1578 signatures: &["string::is_ip(string) -> bool"],
1579 },
1580 BuiltinFn {
1581 name: "string::is_ipv4",
1582 description: "> [!NOTE] > This function was known as string::is::ipv4 in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1583 signatures: &["string::is_ipv4(string) -> bool"],
1584 },
1585 BuiltinFn {
1586 name: "string::is_ipv6",
1587 description: "> [!NOTE] > This function was known as string::is::ipv6 in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1588 signatures: &["string::is_ipv6(string) -> bool"],
1589 },
1590 BuiltinFn {
1591 name: "string::is_latitude",
1592 description: "> [!NOTE] > This function was known as string::is::latitude in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1593 signatures: &["string::is_latitude(string) -> bool"],
1594 },
1595 BuiltinFn {
1596 name: "string::is_longitude",
1597 description: "> [!NOTE] > This function was known as string::is::longitude in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1598 signatures: &["string::is_longitude(string) -> bool"],
1599 },
1600 BuiltinFn {
1601 name: "string::is_numeric",
1602 description: "> [!NOTE] > This function was known as string::is::numeric in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1603 signatures: &["string::is_numeric(string) -> bool"],
1604 },
1605 BuiltinFn {
1606 name: "string::is_record",
1607 description: "> [!NOTE] > This function was known as string::is::record in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1608 signatures: &["string::is_record(string, $table_name: option<string|table>) -> bool"],
1609 },
1610 BuiltinFn {
1611 name: "string::is_semver",
1612 description: "> [!NOTE] > This function was known as string::is::semver in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1613 signatures: &["string::is_semver(string) -> bool"],
1614 },
1615 BuiltinFn {
1616 name: "string::is_ulid",
1617 description: "> [!NOTE] > This function was known as string::is::ulid in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1618 signatures: &["string::is_ulid(string) -> bool"],
1619 },
1620 BuiltinFn {
1621 name: "string::is_url",
1622 description: "> [!NOTE] > This function was known as string::is::url in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1623 signatures: &["string::is_url(string) -> bool"],
1624 },
1625 BuiltinFn {
1626 name: "string::is_uuid",
1627 description: "> [!NOTE] > This function was known as string::is::uuid in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
1628 signatures: &["string::is_uuid(string) -> bool"],
1629 },
1630 BuiltinFn {
1631 name: "string::join",
1632 description: "The string::join function joins strings or stringified values together with a delimiter.",
1633 signatures: &["string::join($delimiter: value, value...) -> string"],
1634 },
1635 BuiltinFn {
1636 name: "string::len",
1637 description: "The string::len function returns the length of a given string in characters.",
1638 signatures: &["string::len(string) -> number"],
1639 },
1640 BuiltinFn {
1641 name: "string::lowercase",
1642 description: "The string::lowercase function converts a string to lowercase.",
1643 signatures: &["string::lowercase(string) -> string"],
1644 },
1645 BuiltinFn {
1646 name: "string::matches",
1647 description: "The string::matches function performs a regex match on a string.",
1648 signatures: &["string::matches(string, $match_with: string|regex) -> bool"],
1649 },
1650 BuiltinFn {
1651 name: "string::repeat",
1652 description: "The string::repeat function repeats a string a number of times.",
1653 signatures: &["string::repeat(string, $times: number) -> string"],
1654 },
1655 BuiltinFn {
1656 name: "string::replace",
1657 description: "The string::replace function replaces an occurrence of a string with another string.",
1658 signatures: &[
1659 "string::replace(string, $from: string, $to: string) -> string",
1660 "string::replace(string, $from: string|regex, $to: string) -> string",
1661 ],
1662 },
1663 BuiltinFn {
1664 name: "string::reverse",
1665 description: "The string::reverse function reverses a string.",
1666 signatures: &["string::reverse(string) -> string"],
1667 },
1668 BuiltinFn {
1669 name: "string::semver::compare",
1670 description: "The string::semver::compare function performs a comparison on two semver strings and returns a number.",
1671 signatures: &["string::semver::compare(string, $other: string) -> 1|0|-1"],
1672 },
1673 BuiltinFn {
1674 name: "string::semver::inc::major",
1675 description: "The string::semver::inc::major function increments the major number of a semver string. As a result, the minor and patch numbers are reset to zero.",
1676 signatures: &["string::semver::inc::major(string) -> string"],
1677 },
1678 BuiltinFn {
1679 name: "string::semver::inc::minor",
1680 description: "The string::semver::inc::minor function increments the minor number of a semver string. As a result, the patch number is reset to zero.",
1681 signatures: &["string::semver::inc::minor(string) -> string"],
1682 },
1683 BuiltinFn {
1684 name: "string::semver::inc::patch",
1685 description: "The string::semver::inc::patch function increments the patch number of a semver string.",
1686 signatures: &["string::semver::inc::patch(string) -> string"],
1687 },
1688 BuiltinFn {
1689 name: "string::semver::major",
1690 description: "The string::semver::major function extracts the major number out of a semver string.",
1691 signatures: &["string::semver::major(string) -> number"],
1692 },
1693 BuiltinFn {
1694 name: "string::semver::minor",
1695 description: "The string::semver::minor function extracts the minor number out of a semver string.",
1696 signatures: &["string::semver::minor(string) -> number"],
1697 },
1698 BuiltinFn {
1699 name: "string::semver::patch",
1700 description: "The string::semver::patch function extracts the patch number out of a semver string.",
1701 signatures: &["string::semver::patch(string) -> number"],
1702 },
1703 BuiltinFn {
1704 name: "string::semver::set::major",
1705 description: "The string::semver::set::major function sets the major number of a semver string without changing the minor and patch numbers.",
1706 signatures: &["string::semver::set::major(string, $major: number) -> string"],
1707 },
1708 BuiltinFn {
1709 name: "string::semver::set::minor",
1710 description: "The string::semver::set::minor function sets the minor number of a semver string without changing the major and patch numbers.",
1711 signatures: &["string::semver::set::minor(string, $minor: number) -> string"],
1712 },
1713 BuiltinFn {
1714 name: "string::semver::set::patch",
1715 description: "The string::semver::set::patch function sets the patch number of a semver string without changing the major and minor numbers.",
1716 signatures: &["string::semver::set::patch(string, $patch: number) -> string"],
1717 },
1718 BuiltinFn {
1719 name: "string::similarity::fuzzy",
1720 description: "Built-in function string::similarity::fuzzy",
1721 signatures: &["string::similarity::fuzzy(string, string) -> int"],
1722 },
1723 BuiltinFn {
1724 name: "string::similarity::jaro",
1725 description: "The string::similarity::jaro function returns the Jaro similarity between two strings. Two strings that are identical have a score of 1, while less similar strings will have lower scores as the dis...",
1726 signatures: &["string::similarity::jaro(string, string) -> float"],
1727 },
1728 BuiltinFn {
1729 name: "string::similarity::jaro_winkler",
1730 description: "The string::similarity::jaro_winkler function returns the Jaro-Winkler similarity between two strings. Two strings that are identical have a score of 1, while less similar strings will have lower s...",
1731 signatures: &["string::similarity::jaro_winkler(string, string) -> float"],
1732 },
1733 BuiltinFn {
1734 name: "string::slice",
1735 description: "The string::slice function extracts and returns a section of a string.",
1736 signatures: &["string::slice(string, $from: number, $to: number) -> string"],
1737 },
1738 BuiltinFn {
1739 name: "string::slug",
1740 description: "The string::slug function converts a string into a human and URL-friendly string.",
1741 signatures: &["string::slug(string) -> string"],
1742 },
1743 BuiltinFn {
1744 name: "string::split",
1745 description: "The string::split function splits a string by a given delimiter.",
1746 signatures: &["string::split(string, $delimiter: string) -> array"],
1747 },
1748 BuiltinFn {
1749 name: "string::starts_with",
1750 description: "> [!NOTE] > This function was known as string::startsWith in versions of SurrrealDB before 2.0. The behaviour has not changed.",
1751 signatures: &["string::starts_with(string, $predicate: string) -> bool"],
1752 },
1753 BuiltinFn {
1754 name: "string::trim",
1755 description: "The string::trim function removes whitespace from the start and end of a string.",
1756 signatures: &["string::trim(string) -> string"],
1757 },
1758 BuiltinFn {
1759 name: "string::uppercase",
1760 description: "The string::uppercase function converts a string to uppercase.",
1761 signatures: &["string::uppercase(string) -> string"],
1762 },
1763 BuiltinFn {
1764 name: "string::words",
1765 description: "The string::words function splits a string into an array of separate words.",
1766 signatures: &["string::words(string) -> array"],
1767 },
1768 BuiltinFn {
1769 name: "time::ceil",
1770 description: "The time::ceil function rounds a datetime up to the next largest duration.",
1771 signatures: &["time::ceil(datetime, $ceiling: duration) -> datetime"],
1772 },
1773 BuiltinFn {
1774 name: "time::day",
1775 description: "The time::day function extracts the day as a number from a datetime, or from the current date if no datetime argument is present.",
1776 signatures: &["time::day(option<datetime>) -> number"],
1777 },
1778 BuiltinFn {
1779 name: "time::epoch",
1780 description: "The time::epoch constant returns the datetime for the UNIX epoch (January 1, 1970).",
1781 signatures: &[],
1782 },
1783 BuiltinFn {
1784 name: "time::floor",
1785 description: "The time::floor function rounds a datetime down by a specific duration.",
1786 signatures: &["time::floor(datetime, $floor: duration) -> datetime"],
1787 },
1788 BuiltinFn {
1789 name: "time::format",
1790 description: "The time::format function outputs a datetime as a string according to a specific format.",
1791 signatures: &["time::format(datetime, $format: string) -> string"],
1792 },
1793 BuiltinFn {
1794 name: "time::from_micros",
1795 description: "The time::from_micros function calculates a datetime based on the microseconds since January 1, 1970 0:00:00 UTC.",
1796 signatures: &["time::from_micros(number) -> datetime"],
1797 },
1798 BuiltinFn {
1799 name: "time::from_millis",
1800 description: "The time::from_millis function calculates a datetime based on the milliseconds since January 1, 1970 0:00:00 UTC.",
1801 signatures: &["time::from_millis(number) -> datetime"],
1802 },
1803 BuiltinFn {
1804 name: "time::from_nanos",
1805 description: "The time::from_nanos function calculates a datetime based on the nanoseconds since January 1, 1970 0:00:00 UTC.",
1806 signatures: &["time::from_nanos(number) -> datetime"],
1807 },
1808 BuiltinFn {
1809 name: "time::from_secs",
1810 description: "The time::from_secs function calculates a datetime based on the seconds since January 1, 1970 0:00:00 UTC.",
1811 signatures: &["time::from_secs(number) -> datetime"],
1812 },
1813 BuiltinFn {
1814 name: "time::from_ulid",
1815 description: "The time::from_ulid function calculates a datetime based on the ULID.",
1816 signatures: &["time::from_ulid(ulid) -> datetime"],
1817 },
1818 BuiltinFn {
1819 name: "time::from_unix",
1820 description: "The time::from_unix function calculates a datetime based on the seconds since January 1, 1970 0:00:00 UTC.",
1821 signatures: &["time::from_unix(number) -> datetime"],
1822 },
1823 BuiltinFn {
1824 name: "time::from_uuid",
1825 description: "The time::from_uuid function calculates a datetime based on the UUID.",
1826 signatures: &["time::from_uuid(uuid) -> datetime"],
1827 },
1828 BuiltinFn {
1829 name: "time::group",
1830 description: "The time::group function reduces and rounds a datetime down to a particular time interval.",
1831 signatures: &[
1832 "time::group(datetime, $group_by: 'year'|'month'|'day'|'hour'|'minute'|'second') -> datetime",
1833 ],
1834 },
1835 BuiltinFn {
1836 name: "time::hour",
1837 description: "The time::hour function extracts the hour as a number from a datetime, or from the current date if no datetime argument is present.",
1838 signatures: &["time::hour(option<datetime>) -> number"],
1839 },
1840 BuiltinFn {
1841 name: "time::max",
1842 description: "The time::max function returns the greatest datetime from an array of datetimes.",
1843 signatures: &["time::max(array<datetime>) -> datetime"],
1844 },
1845 BuiltinFn {
1846 name: "time::maximum",
1847 description: "The time::maximum constant returns the greatest possible datetime that can be used.",
1848 signatures: &["time::maximum -> datetime"],
1849 },
1850 BuiltinFn {
1851 name: "time::micros",
1852 description: "The time::micros function extracts the microseconds as a number from a datetime, or from the current date if no datetime argument is present.",
1853 signatures: &["time::micros(option<datetime>) -> number"],
1854 },
1855 BuiltinFn {
1856 name: "time::millis",
1857 description: "The time::millis function extracts the milliseconds as a number from a datetime, or from the current date if no datetime argument is present.",
1858 signatures: &["time::millis(option<datetime>) -> number"],
1859 },
1860 BuiltinFn {
1861 name: "time::min",
1862 description: "The time::min function returns the least datetime from an array of datetimes.",
1863 signatures: &["time::min(array<datetime>) -> datetime"],
1864 },
1865 BuiltinFn {
1866 name: "time::minimum",
1867 description: "The time::minimum constant returns the least possible datetime that can be used.",
1868 signatures: &["time::minimum -> datetime"],
1869 },
1870 BuiltinFn {
1871 name: "time::minute",
1872 description: "The time::minute function extracts the minutes as a number from a datetime, or from the current date if no datetime argument is present.",
1873 signatures: &["time::minute(option<datetime>) -> number"],
1874 },
1875 BuiltinFn {
1876 name: "time::month",
1877 description: "The time::month function extracts the month as a number from a datetime, or from the current date if no datetime argument is present.",
1878 signatures: &["time::month(option<datetime>) -> number"],
1879 },
1880 BuiltinFn {
1881 name: "time::nano",
1882 description: "The time::nanofunction returns a datetime as an integer representing the number of nanoseconds since the UNIX epoch until a datetime, or the current date if no datetime argument is present.",
1883 signatures: &["time::nano(option<datetime>) -> number"],
1884 },
1885 BuiltinFn {
1886 name: "time::now",
1887 description: "The time::now function returns the current datetime as an ISO8601 timestamp.",
1888 signatures: &["time::now() -> datetime"],
1889 },
1890 BuiltinFn {
1891 name: "time::round",
1892 description: "The time::round function rounds a datetime up by a specific duration.",
1893 signatures: &["time::round(datetime, $round_to: duration) -> datetime"],
1894 },
1895 BuiltinFn {
1896 name: "time::second",
1897 description: "The time::second function extracts the second as a number from a datetime, or from the current date if no datetime argument is present.",
1898 signatures: &["time::second(option<datetime>) -> number"],
1899 },
1900 BuiltinFn {
1901 name: "time::set_day",
1902 description: "The time::set_day function sets the day value of a datetime.",
1903 signatures: &["time::set_day(datetime, $day: integer) -> datetime"],
1904 },
1905 BuiltinFn {
1906 name: "time::set_hour",
1907 description: "The time::set_hour function sets the hour value of a datetime.",
1908 signatures: &["time::set_hour(datetime, $hour: integer) -> datetime"],
1909 },
1910 BuiltinFn {
1911 name: "time::set_minute",
1912 description: "The time::set_minute function sets the minute value of a datetime.",
1913 signatures: &["time::set_minute(datetime, $minute: integer) -> datetime"],
1914 },
1915 BuiltinFn {
1916 name: "time::set_month",
1917 description: "The time::set_month function sets the month value of a datetime.",
1918 signatures: &["time::set_month(datetime, $month: integer) -> datetime"],
1919 },
1920 BuiltinFn {
1921 name: "time::set_nanosecond",
1922 description: "The time::set_nanosecond function sets the nanosecond value of a datetime.",
1923 signatures: &["time::set_nanosecond(datetime, $nanosecond: integer) -> datetime"],
1924 },
1925 BuiltinFn {
1926 name: "time::set_second",
1927 description: "The time::set_second function sets the second value of a datetime.",
1928 signatures: &["time::set_second(datetime, $second: integer) -> datetime"],
1929 },
1930 BuiltinFn {
1931 name: "time::set_year",
1932 description: "The time::set_year function sets the year value of a datetime.",
1933 signatures: &["time::set_year(datetime, $year: integer) -> datetime"],
1934 },
1935 BuiltinFn {
1936 name: "time::timezone",
1937 description: "The time::timezone function returns the current local timezone offset in hours.",
1938 signatures: &["time::timezone() -> string"],
1939 },
1940 BuiltinFn {
1941 name: "time::unix",
1942 description: "The time::unix function returns a datetime as an integer representing the number of seconds since the UNIX epoch until a certain datetime, or from the current date if no datetime argument is present.",
1943 signatures: &["time::unix(option<datetime>) -> number"],
1944 },
1945 BuiltinFn {
1946 name: "time::wday",
1947 description: "The time::wday function extracts the week day as a number from a datetime, or from the current date if no datetime argument is present.",
1948 signatures: &["time::wday(option<datetime>) -> number"],
1949 },
1950 BuiltinFn {
1951 name: "time::week",
1952 description: "The time::week function extracts the week as a number from a datetime, or from the current date if no datetime argument is present.",
1953 signatures: &["time::week(option<datetime>) -> number"],
1954 },
1955 BuiltinFn {
1956 name: "time::yday",
1957 description: "The time::yday function extracts the day of the year as a number from a datetime, or from the current date if no datetime argument is present.",
1958 signatures: &["time::yday(option<datetime>) -> number"],
1959 },
1960 BuiltinFn {
1961 name: "time::year",
1962 description: "The time::year function extracts the year as a number from a datetime, or from the current date if no datetime argument is present.",
1963 signatures: &["time::year(option<datetime>) -> number"],
1964 },
1965 BuiltinFn {
1966 name: "type::array",
1967 description: "The type::array function converts a value into an array.",
1968 signatures: &["type::array(array|range) -> array"],
1969 },
1970 BuiltinFn {
1971 name: "type::bool",
1972 description: "The type::bool function converts a value into a boolean.",
1973 signatures: &["type::bool(bool|string) -> bool"],
1974 },
1975 BuiltinFn {
1976 name: "type::bytes",
1977 description: "The type::bytes function converts a value into bytes.",
1978 signatures: &["type::bytes(bytes|string) -> bool"],
1979 },
1980 BuiltinFn {
1981 name: "type::datetime",
1982 description: "The type::datetime function converts a value into a datetime.",
1983 signatures: &["type::datetime(datetime|string) -> datetime"],
1984 },
1985 BuiltinFn {
1986 name: "type::decimal",
1987 description: "The type::decimal function converts a value into a decimal.",
1988 signatures: &["type::decimal(decimal|float|int|number|string) -> decimal"],
1989 },
1990 BuiltinFn {
1991 name: "type::duration",
1992 description: "The type::duration function converts a value into a duration.",
1993 signatures: &["type::duration(duration|string) -> duration"],
1994 },
1995 BuiltinFn {
1996 name: "type::field",
1997 description: "The type::field function projects a single field within a SELECT statement.",
1998 signatures: &["type::field(string)"],
1999 },
2000 BuiltinFn {
2001 name: "type::fields",
2002 description: "The type::fields function projects one or more fields within a SELECT statement.",
2003 signatures: &["type::fields(array<string>)"],
2004 },
2005 BuiltinFn {
2006 name: "type::file",
2007 description: "The type::file function converts two strings representing a bucket name and a key into a file pointer.",
2008 signatures: &["type::file($bucket: string, $key: string) -> file"],
2009 },
2010 BuiltinFn {
2011 name: "type::float",
2012 description: "The type::float function converts a value into a float.",
2013 signatures: &["type::float(decimal|float|int|number|string) -> float"],
2014 },
2015 BuiltinFn {
2016 name: "type::int",
2017 description: "The type::int function converts a value into an integer.",
2018 signatures: &["type::int(decimal|float|int|number|string) -> int"],
2019 },
2020 BuiltinFn {
2021 name: "type::is_array",
2022 description: "> [!NOTE] > This function was known as type::is::array in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2023 signatures: &["type::is_array(any) -> bool"],
2024 },
2025 BuiltinFn {
2026 name: "type::is_bool",
2027 description: "> [!NOTE] > This function was known as type::is::bool in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2028 signatures: &["type::is_bool(any) -> bool"],
2029 },
2030 BuiltinFn {
2031 name: "type::is_bytes",
2032 description: "> [!NOTE] > This function was known as type::is::bytes in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2033 signatures: &["type::is_bytes(any) -> bool"],
2034 },
2035 BuiltinFn {
2036 name: "type::is_collection",
2037 description: "> [!NOTE] > This function was known as type::is::collection in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2038 signatures: &["type::is_collection(any) -> bool"],
2039 },
2040 BuiltinFn {
2041 name: "type::is_datetime",
2042 description: "> [!NOTE] > This function was known as type::is::datetime in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2043 signatures: &["type::is_datetime(any) -> bool"],
2044 },
2045 BuiltinFn {
2046 name: "type::is_decimal",
2047 description: "> [!NOTE] > This function was known as type::is::decimal in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2048 signatures: &["type::is_decimal(any) -> bool"],
2049 },
2050 BuiltinFn {
2051 name: "type::is_duration",
2052 description: "> [!NOTE] > This function was known as type::is::duration in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2053 signatures: &["type::is_duration(any) -> bool"],
2054 },
2055 BuiltinFn {
2056 name: "type::is_float",
2057 description: "> [!NOTE] > This function was known as type::is::float in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2058 signatures: &["type::is_float(any) -> bool"],
2059 },
2060 BuiltinFn {
2061 name: "type::is_geometry",
2062 description: "> [!NOTE] > This function was known as type::is::geometry in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2063 signatures: &["type::is_geometry(any) -> bool"],
2064 },
2065 BuiltinFn {
2066 name: "type::is_int",
2067 description: "> [!NOTE] > This function was known as type::is::int in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2068 signatures: &["type::is_int(any) -> bool"],
2069 },
2070 BuiltinFn {
2071 name: "type::is_line",
2072 description: "> [!NOTE] > This function was known as type::is::line in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2073 signatures: &["type::is_line(any) -> bool"],
2074 },
2075 BuiltinFn {
2076 name: "type::is_multiline",
2077 description: "> [!NOTE] > This function was known as type::is::multiline in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2078 signatures: &["type::is_multiline(any) -> bool"],
2079 },
2080 BuiltinFn {
2081 name: "type::is_multipoint",
2082 description: "> [!NOTE] > This function was known as type::is::multipoint in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2083 signatures: &["type::is_multipoint(any) -> bool"],
2084 },
2085 BuiltinFn {
2086 name: "type::is_multipolygon",
2087 description: "> [!NOTE] > This function was known as type::is::multipolygon in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2088 signatures: &["type::is_multipolygon(any) -> bool"],
2089 },
2090 BuiltinFn {
2091 name: "type::is_none",
2092 description: "> [!NOTE] > This function was known as type::is::none in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2093 signatures: &["type::is_none(any) -> bool"],
2094 },
2095 BuiltinFn {
2096 name: "type::is_null",
2097 description: "> [!NOTE] > This function was known as type::is::null in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2098 signatures: &["type::is_null(any) -> bool"],
2099 },
2100 BuiltinFn {
2101 name: "type::is_number",
2102 description: "> [!NOTE] > This function was known as type::is::number in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2103 signatures: &["type::is_number(any) -> bool"],
2104 },
2105 BuiltinFn {
2106 name: "type::is_object",
2107 description: "> [!NOTE] > This function was known as type::is::object in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2108 signatures: &["type::is_object(any) -> bool"],
2109 },
2110 BuiltinFn {
2111 name: "type::is_point",
2112 description: "> [!NOTE] > This function was known as type::is::point in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2113 signatures: &["type::is_point(any) -> bool"],
2114 },
2115 BuiltinFn {
2116 name: "type::is_polygon",
2117 description: "> [!NOTE] > This function was known as type::is::polygon in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2118 signatures: &["type::is_polygon(any) -> bool"],
2119 },
2120 BuiltinFn {
2121 name: "type::is_range",
2122 description: "> [!NOTE] > This function was known as type::is::range in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2123 signatures: &["type::is_range(any) -> bool"],
2124 },
2125 BuiltinFn {
2126 name: "type::is_record",
2127 description: "> [!NOTE] > This function was known as type::is::record in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2128 signatures: &["type::is_record(any) -> bool"],
2129 },
2130 BuiltinFn {
2131 name: "type::is_string",
2132 description: "> [!NOTE] > This function was known as type::is::string in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2133 signatures: &["type::is_string(any) -> bool"],
2134 },
2135 BuiltinFn {
2136 name: "type::is_uuid",
2137 description: "> [!NOTE] > This function was known as type::is::uuid in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2138 signatures: &["type::is_uuid(any) -> bool"],
2139 },
2140 BuiltinFn {
2141 name: "type::number",
2142 description: "The type::number function converts a value into a number.",
2143 signatures: &["type::number(decimal|float|int|number|string) -> number"],
2144 },
2145 BuiltinFn {
2146 name: "type::point",
2147 description: "The type::point function converts a value into a geometry point.",
2148 signatures: &["type::point(array|point) -> point"],
2149 },
2150 BuiltinFn {
2151 name: "type::range",
2152 description: "The type::range function converts a value into a range. It accepts a single argument, either a range or an array with two values. If the argument is an array, it will be converted into a range, sim...",
2153 signatures: &["type::range(range|array) -> range<record>"],
2154 },
2155 BuiltinFn {
2156 name: "type::record",
2157 description: "> [!NOTE] > This function was known as type::thing in versions of SurrrealDB before 3.0.0-beta. The behaviour has not changed.",
2158 signatures: &[
2159 "type::record($table: any, $key: any) -> record",
2160 "type::record($record: record|string, $table_name: option<string>) -> record",
2161 ],
2162 },
2163 BuiltinFn {
2164 name: "type::string",
2165 description: "The type::string function converts any value except NONE, NULL, and bytes into a string.",
2166 signatures: &["type::string(any) -> string"],
2167 },
2168 BuiltinFn {
2169 name: "type::string_lossy",
2170 description: "The type::string_lossy function converts any value except NONE, NULL, and bytes into a string. In the case of bytes, it will not return an error if the bytes are not valid UTF-8. Instead, invalid b...",
2171 signatures: &["type::string(any) -> string"],
2172 },
2173 BuiltinFn {
2174 name: "type::table",
2175 description: "The type::table function converts a value into a table name.",
2176 signatures: &["type::table(record|string) -> string"],
2177 },
2178 BuiltinFn {
2179 name: "type::uuid",
2180 description: "The type::uuid function converts a value into a UUID.",
2181 signatures: &["type::uuid(string|uuid) -> uuid"],
2182 },
2183 BuiltinFn {
2184 name: "value::diff",
2185 description: "The value::diff function returns an object that shows the JSON Patch operation(s) required for the first value to equal the second one.",
2186 signatures: &["value::diff(value, $other: value) -> array<object>"],
2187 },
2188 BuiltinFn {
2189 name: "value::patch",
2190 description: "The value::patch function applies an array of JSON Patch operations to a value.",
2191 signatures: &["value::patch(value, $patch: array<object>) -> value"],
2192 },
2193 BuiltinFn {
2194 name: "vector::add",
2195 description: "The vector::add function performs element-wise addition of two vectors, where each element in the first vector is added to the corresponding element in the second vector.",
2196 signatures: &["vector::add(array, $other: array) -> array"],
2197 },
2198 BuiltinFn {
2199 name: "vector::angle",
2200 description: "The vector::angle function computes the angle between two vectors, providing a measure of the orientation difference between them.",
2201 signatures: &["vector::angle(array, $other: array) -> number"],
2202 },
2203 BuiltinFn {
2204 name: "vector::cross",
2205 description: "The vector::cross function computes the cross product of two vectors, which results in a vector that is orthogonal (perpendicular) to the plane containing the original vectors.",
2206 signatures: &["vector::cross(array, $other: array) -> array"],
2207 },
2208 BuiltinFn {
2209 name: "vector::distance::chebyshev",
2210 description: "The vector::distance::chebyshev function computes the Chebyshev distance (also known as maximum value distance) between two vectors, which is the greatest of their differences along any coordinate ...",
2211 signatures: &["vector::distance::chebyshev(array, $other: array) -> number"],
2212 },
2213 BuiltinFn {
2214 name: "vector::distance::euclidean",
2215 description: "The vector::distance::euclidean function computes the Euclidean distance between two vectors, providing a measure of the straight-line distance between two points in a multi-dimensional space.",
2216 signatures: &["vector::distance::euclidean(array, $other: array) -> number"],
2217 },
2218 BuiltinFn {
2219 name: "vector::distance::hamming",
2220 description: "The vector::distance::hamming function computes the Hamming distance between two vectors, measuring the minimum number of substitutions required to change one vector into the other, useful for comp...",
2221 signatures: &["vector::distance::hamming(array, $other: array) -> number"],
2222 },
2223 BuiltinFn {
2224 name: "vector::distance::knn",
2225 description: "The vector::distance::knn function returns the distance computed during the query by the Knn operator (avoiding recomputation).",
2226 signatures: &["vector::distance::knn() -> number"],
2227 },
2228 BuiltinFn {
2229 name: "vector::distance::manhattan",
2230 description: "The vector::distance::manhattan function computes the Manhattan distance (also known as the L1 norm or Taxicab geometry) between two vectors, which is the sum of the absolute differences of their ...",
2231 signatures: &["vector::distance::manhattan(array, $other: array) -> number"],
2232 },
2233 BuiltinFn {
2234 name: "vector::distance::minkowski",
2235 description: "The vector::distance::minkowski function computes the Minkowski distance between two vectors, a generalization of other distance metrics such as Euclidean and Manhattan when parameterized with diff...",
2236 signatures: &[
2237 "vector::distance::minkowski(array, $other: array, $p_value: number) -> number",
2238 ],
2239 },
2240 BuiltinFn {
2241 name: "vector::divide",
2242 description: "The vector::divide function performs element-wise division between two vectors, where each element in the first vector is divided by the corresponding element in the second vector.",
2243 signatures: &["vector::divide(array, $other: array) -> array"],
2244 },
2245 BuiltinFn {
2246 name: "vector::dot",
2247 description: "The vector::dot function computes the dot product of two vectors, which is the sum of the products of the corresponding entries of the two sequences of numbers.",
2248 signatures: &["vector::dot(array, $other: array) -> number"],
2249 },
2250 BuiltinFn {
2251 name: "vector::magnitude",
2252 description: "The vector::magnitude function computes the magnitude (or length) of a vector, providing a measure of the size of the vector in multi-dimensional space.",
2253 signatures: &["vector::magnitude(array) -> number"],
2254 },
2255 BuiltinFn {
2256 name: "vector::multiply",
2257 description: "The vector::multiply function performs element-wise multiplication of two vectors, where each element in the first vector is multiplied by the corresponding element in the second vector.",
2258 signatures: &["vector::multiply(array, $other: array) -> number"],
2259 },
2260 BuiltinFn {
2261 name: "vector::normalize",
2262 description: "The vector::normalize function computes the normalization of a vector, transforming it to a unit vector (a vector of length 1) that maintains the original direction.",
2263 signatures: &["vector::normalize(array) -> array"],
2264 },
2265 BuiltinFn {
2266 name: "vector::project",
2267 description: "The vector::project function computes the projection of one vector onto another, providing a measure of the shadow of one vector on the other. The projection is obtained by multiplying the magnitud...",
2268 signatures: &["vector::project(array, $other: array) -> array"],
2269 },
2270 BuiltinFn {
2271 name: "vector::scale",
2272 description: "The vector::scale function multiplies each item in a vector by a number.",
2273 signatures: &["vector::scale(array, $other: number) -> array"],
2274 },
2275 BuiltinFn {
2276 name: "vector::similarity::cosine",
2277 description: "The vector::similarity::cosine function computes the Cosine similarity between two vectors, indicating the cosine of the angle between them, which is a measure of how closely two vectors are orient...",
2278 signatures: &["vector::similarity::cosine(array, $other: array) -> number"],
2279 },
2280 BuiltinFn {
2281 name: "vector::similarity::jaccard",
2282 description: "The vector::similarity::jaccard function computes the Jaccard similarity between two vectors, measuring the intersection divided by the union of the datasets represented by the vectors.",
2283 signatures: &["vector::similarity::jaccard(array, $other: array) -> number"],
2284 },
2285 BuiltinFn {
2286 name: "vector::similarity::pearson",
2287 description: "The vector::similarity::pearson function Computes the Pearson correlation coefficient between two vectors, reflecting the degree of linear relationship between them.",
2288 signatures: &["vector::similarity::pearson(array, array) -> number"],
2289 },
2290 BuiltinFn {
2291 name: "vector::subtract",
2292 description: "The vector::subtract function performs element-wise subtraction between two vectors, where each element in the second vector is subtracted from the corresponding element in the first vector.",
2293 signatures: &["vector::subtract(array, $other: array) -> array"],
2294 },
2295];