You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/n1ql/pages/n1ql-language-reference/metafun.adoc
+123-7Lines changed: 123 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -428,7 +428,8 @@ SELECT `Flavor` FROM EVALUATE("INFER `travel-sample`")[0] inf;
428
428
=== Description
429
429
430
430
This function extracts Data Definition Language (DDL) statements of buckets and returns them as an array of strings.
431
-
It retrieves definitions for buckets, scopes, collections, indexes, and sequences.
431
+
It retrieves definitions for buckets, scopes, collections, indexes, sequences, functions, and prepared statements.
432
+
432
433
You can use these definitions for purposes such as replication, backup, or auditing.
433
434
434
435
The function supports the following statements:
@@ -438,6 +439,8 @@ The function supports the following statements:
438
439
* CREATE COLLECTION
439
440
* CREATE INDEX
440
441
* CREATE SEQUENCE
442
+
* CREATE OR REPLACE FUNCTION [.status]#Couchbase Server 8.0.1#
443
+
* PREPARE [.status]#Couchbase Server 8.0.1#
441
444
442
445
NOTE: To execute this function, you must have the `query_system_catalog` role.
443
446
Also, to extract DDLs from a specific bucket, you need necessary permissions on that bucket.
@@ -463,12 +466,12 @@ If you omit this argument, the output includes all supported DDL statements.
463
466
__optional__
464
467
| Specifies the types of DDL statements to extract.
465
468
466
-
Accepts either a numeric value or an array of strings, but not both.
469
+
Accepts either a number or an array of strings, but not both.
467
470
468
-
[options="header", cols="1a,1a,1a"]
471
+
[options="header", cols="3a,2a,1a"]
469
472
!===
470
473
471
-
! Statement ! String Value ! Numeric Value
474
+
! Statement ! String ! Number
472
475
473
476
! CREATE BUCKET
474
477
! `"bucket"`
@@ -489,6 +492,17 @@ Accepts either a numeric value or an array of strings, but not both.
489
492
! CREATE SEQUENCE
490
493
! `"sequence"`
491
494
! `16`
495
+
496
+
! CREATE OR REPLACE FUNCTION +
497
+
[.status]#Couchbase Server 8.0.1#
498
+
499
+
! `"function"`
500
+
! `32`
501
+
502
+
! PREPARE +
503
+
[.status]#Couchbase Server 8.0.1#
504
+
! `"prepared"`
505
+
! `64`
492
506
!===
493
507
494
508
To extract multiple statement types, specify an array of their string values or a single numeric value that represents the sum of their respective numeric values.
@@ -505,7 +519,7 @@ An array of strings, with each string containing a DDL statement.
505
519
=== Examples
506
520
507
521
[[extract-ddl-ex1,EXTRACTDDL() Example 1]]
508
-
.Using a string flag to extract CREATE INDEX statements from the `travel-sample` bucket
522
+
.Extract CREATE INDEX statements from the `travel-sample` bucket using a string flag
0 commit comments