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
@@ -426,7 +426,8 @@ SELECT `Flavor` FROM EVALUATE("INFER `travel-sample`")[0] inf;
426
426
=== Description
427
427
428
428
This function extracts Data Definition Language (DDL) statements of buckets and returns them as an array of strings.
429
-
It retrieves definitions for buckets, scopes, collections, indexes, and sequences.
429
+
It retrieves definitions for buckets, scopes, collections, indexes, sequences, functions, and prepared statements.
430
+
430
431
You can use these definitions for purposes such as replication, backup, or auditing.
431
432
432
433
The function supports the following statements:
@@ -436,6 +437,8 @@ The function supports the following statements:
436
437
* CREATE COLLECTION
437
438
* CREATE INDEX
438
439
* CREATE SEQUENCE
440
+
* CREATE OR REPLACE FUNCTION [.status]#Couchbase Server 8.0.1#
441
+
* PREPARE [.status]#Couchbase Server 8.0.1#
439
442
440
443
NOTE: To execute this function, you must have the `query_system_catalog` role.
441
444
Also, to extract DDLs from a specific bucket, you need necessary permissions on that bucket.
@@ -461,12 +464,12 @@ If you omit this argument, the output includes all supported DDL statements.
461
464
__optional__
462
465
| Specifies the types of DDL statements to extract.
463
466
464
-
Accepts either a numeric value or an array of strings, but not both.
467
+
Accepts either a number or an array of strings, but not both.
465
468
466
-
[options="header", cols="1a,1a,1a"]
469
+
[options="header", cols="3a,2a,1a"]
467
470
!===
468
471
469
-
! Statement ! String Value ! Numeric Value
472
+
! Statement ! String ! Number
470
473
471
474
! CREATE BUCKET
472
475
! `"bucket"`
@@ -487,6 +490,17 @@ Accepts either a numeric value or an array of strings, but not both.
487
490
! CREATE SEQUENCE
488
491
! `"sequence"`
489
492
! `16`
493
+
494
+
! CREATE OR REPLACE FUNCTION +
495
+
[.status]#Couchbase Server 8.0.1#
496
+
497
+
! `"function"`
498
+
! `32`
499
+
500
+
! PREPARE +
501
+
[.status]#Couchbase Server 8.0.1#
502
+
! `"prepared"`
503
+
! `64`
490
504
!===
491
505
492
506
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.
@@ -503,7 +517,7 @@ An array of strings, with each string containing a DDL statement.
503
517
=== Examples
504
518
505
519
[[extract-ddl-ex1,EXTRACTDDL() Example 1]]
506
-
.Using a string flag to extract CREATE INDEX statements from the `travel-sample` bucket
520
+
.Extract CREATE INDEX statements from the `travel-sample` bucket using a string flag
0 commit comments