Skip to content

Commit 96b1964

Browse files
authored
DOC-9754 -- SQL++ change (#680)
https://issues.couchbase.com/browse/DOC-9754 QF220223-5 -- GA Sweep to add SQL++ DOC-9754 -- SQL++ change https://issues.couchbase.com/browse/DOC-9754 DOC-9754 -- SQL++ change https://issues.couchbase.com/browse/DOC-9754
1 parent 536cdd8 commit 96b1964

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+144
-130
lines changed

antora.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ asciidoc:
2424
maintenance: 0
2525
base: 0
2626
page-toclevels: 2@
27+
sqlpp: SQL++
2728
# releasetag:
2829
# show_edition:
2930

modules/ROOT/pages/_partials/_attributes-local.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ifdef::releasetag[:tag: -{releasetag}]
2626
// :_page-status-review: in-review
2727
// :xrefstyle: full
2828
// :more: Read More
29-
:sqlpp: pass:q,a[SQL++]
29+
// :sqlpp: pass:q,a[{sqlpp}]
3030
:idprefix:
3131
:idseparator: -
3232
:blank-field: ____
@@ -281,12 +281,13 @@ ifdef::is-beta[:url-api-references-pfx: {url-api-references-beta}]
281281
:url-issues-swift: {url-github-cbl}-ios/issues
282282

283283

284-
:url-tutorial-mobile-workshop: {url-tutorials}mobile-travel-sample/introduction.html[Couchbase Mobile Workshop]
284+
:url-tutorial-mobile-workshop: {url-tutorials}mobile-travel-tutorial/introduction.html
285+
285286
:couchbase-tutorials--mobile-workshop--xref: {url-tutorial-mobile-workshop}[Couchbase Mobile Workshop]
286287

287288

288289

289-
:url-n1ql-tutorial: https://query-tutorial.couchbase.com/tutorial/#1[N1QL Tutorials]
290+
:url-n1ql-tutorial: https://query-tutorial.couchbase.com/tutorial/#1[{sqlpp} Tutorials]
290291

291292
// END URLs
292293

modules/ROOT/pages/_partials/_block-caveats.adoc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,14 @@ image::ROOT:xcode-12x3-fix.png[]
130130
On upgrading from a 2.x release, all Couchbase Lite databases will be automatically re-indexed on initial database open. +
131131
This can result in a delay before the database is usable.
132132
--
133-
// end::cbl-3-0-0-reindexing[]
133+
// end::cbl-3-0-0-reindexing[]
134+
135+
136+
// tag::N1QL-SQL[]
137+
[IMPORTANT]
138+
--
139+
N1QL is Couchbase's implementation of the developing *{sqlpp}* standard.
140+
As such the terms _N1QL_ and _{sqlpp}_ are used interchangeably in Couchbase documentation unless explicitly stated otherwise.
141+
--
142+
143+
// end::N1QL-SQL[]

modules/ROOT/pages/_partials/_page-index.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ ifndef::version[:version: version undefined]
130130
:querybuilder--xref: {querybuilder--pfx}[QueryBuilder]
131131

132132
:query-n1ql-mobile--page: query-n1ql-mobile.adoc
133-
:query-n1ql-mobile--xref: {cbl--xref}{query-n1ql-mobile--page}[N1QL for Mobile]
133+
:query-n1ql-mobile--xref: {cbl--xref}{query-n1ql-mobile--page}[{sqlpp} for Mobile]
134134

135135
:query-n1ql-mobile-querybuilder-diffs--page: query-n1ql-mobile-querybuilder-diffs.adoc
136-
:query-n1ql-mobile-querybuilder-diffs--xref: {cbl--xref}{query-n1ql-mobile-querybuilder-diffs--page}[N1QL Mobile - Querybuilder Differences]
136+
:query-n1ql-mobile-querybuilder-diffs--xref: {cbl--xref}{query-n1ql-mobile-querybuilder-diffs--page}[{sqlpp} Mobile - Querybuilder Differences]
137137

138138
:query-n1ql-mobile-server-diffs--page: query-n1ql-mobile-server-diffs.adoc
139-
:query-n1ql-mobile-server-diffs--xref: {cbl--xref}{query-n1ql-mobile-server-diffs--page}[N1QL Mobile - N1QL Server Differences]
139+
:query-n1ql-mobile-server-diffs--xref: {cbl--xref}{query-n1ql-mobile-server-diffs--page}[{sqlpp} Mobile - {sqlpp} Server Differences]
140140

141141
:query-live--page: query-live.adoc
142142
:query-live--xref: {cbl--xref}{query-live--page}[Live Queries]
@@ -207,9 +207,9 @@ ifndef::version[:version: version undefined]
207207
// END Sync Gateway Links
208208

209209
// BEGIN -- Couchbase Server XREFS
210-
:svr-n1ql-datamodel--xref: {svr--xref}learn:data/n1ql-versus-sql.adoc[N1QL Data Model]
211-
:svr-n1ql-reference--xref: {svr--xref}n1ql:n1ql-language-reference/index.adoc[N1QL Reference Guide]
212-
:svr-n1ql-reference-orderby--xref: {svr--xref}n1ql:n1ql-language-reference/orderby.adoc[N1QL (server) OrderBy clause]
210+
:svr-n1ql-datamodel--xref: {svr--xref}learn:data/n1ql-versus-sql.adoc[{sqlpp} Data Model]
211+
:svr-n1ql-reference--xref: {svr--xref}n1ql:n1ql-language-reference/index.adoc[{sqlpp} Reference Guide]
212+
:svr-n1ql-reference-orderby--xref: {svr--xref}n1ql:n1ql-language-reference/orderby.adoc[{sqlpp} (server) OrderBy clause]
213213
// END -- Couchbase Server XREFS
214214

215215
// BEGIN -- tutorial xrefs

modules/ROOT/pages/_partials/commons/common-fts.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ include::{root-partials}block-abstract.adoc[]
1212
To run a full-text search (FTS) query, you must create a full-text index on the expression being matched.
1313
Unlike regular queries, the index is not optional.
1414

15-
ifndef::is-c[You can choose to use N1QL or QueryBuilder syntaxes to create and use FTS indexes.]
15+
ifndef::is-c[You can choose to use {sqlpp} or QueryBuilder syntaxes to create and use FTS indexes.]
1616

1717
The following examples use the data model introduced in {indexing--xref}.
1818
They create and use an FTS index built from the hotel's `Overview` text.
1919

2020
ifdef::is-c[== Create Index]
2121
ifndef::is-c[]
22-
== N1QL
22+
== {sqlpp}
2323

2424
=== Create Index
2525
endif::is-c[]
@@ -35,13 +35,13 @@ include::{root-partials}_block_tabbed_code_example.adoc[]
3535
ifndef::is-c[=== Use Index]
3636
ifdef::is-c[== Use Index]
3737

38-
FullTextSearch is enabled using the N1QL match() function.
38+
FullTextSearch is enabled using the {sqlpp} match() function.
3939

4040
With the index created, you can construct and run a Full-text search (FTS) query using the indexed properties.
4141

4242
The following example finds all hotels mentioning _Michigan_ in their _Overview_ text.
4343

44-
.Using N1QL Full Text Search
44+
.Using {sqlpp} Full Text Search
4545
[#ex-indexbuilder]
4646
:param-tags: fts-query
4747
include::{root-partials}_block_tabbed_code_example.adoc[]
@@ -83,7 +83,7 @@ include::{root-partials}_block_tabbed_code_example.adoc[]
8383

8484
// == Constructing a Query
8585

86-
// FullTextSearch is enabled using the N1QL match() function.
86+
// FullTextSearch is enabled using the {sqlpp} match() function.
8787
// With the index created, you can construct and run a Full-text search (FTS) query on the indexed properties.
8888

8989

modules/ROOT/pages/_partials/commons/common-indexing.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ include::{root-partials}_block-caveats.adoc[tag=index-partial-value]
3939

4040
== Creating a new index
4141

42-
You can use N1QL or QueryBuilder syntaxes to create an index
42+
You can use {sqlpp} or QueryBuilder syntaxes to create an index
4343

4444
// === N1QL
45-
// N1QL provides a configuration object to define indexes --
45+
// {sqlpp} provides a configuration object to define indexes --
4646
// `ValueIndexConfiguration`.
4747

4848
// The following example inserts documents and creates an FTS index on the `name and type` properties.

modules/ROOT/pages/_partials/commons/common-query-n1ql-mobile-querybuilder-diffs.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

33
// tag::content[]
4-
Couchbase Lite's N1QL for Mobile supports all QueryBuilder features, except _Predictive Query_ and _Index_. +
5-
See <<tbl-qbldr-diffs>> for the features supported by N1QL but not by QueryBuilder.
4+
Couchbase Lite's {sqlpp} for Mobile supports all QueryBuilder features, except _Predictive Query_ and _Index_. +
5+
See <<tbl-qbldr-diffs>> for the features supported by {sqlpp} but not by QueryBuilder.
66

77

88
.QueryBuilder Differences

modules/ROOT/pages/_partials/commons/common-query-n1ql-mobile-server-diffs.adoc

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// = N1QL for Analytics vs. N1QL for Mobile
2-
// :description: A comparison between N1QL for Analytics and N1QL for Query.
1+
// = {sqlpp} for Analytics vs. {sqlpp} for Mobile
2+
// :description: A comparison between {sqlpp} for Analytics and {sqlpp} for Query.
33
// :page-edition: Enterprise Edition
44
// BEGIN -- inclusion -- common-querybuilder.adoc
55
// Purpose -- describes the use of the query syntax
@@ -14,23 +14,25 @@
1414
// END::REQUIRED EXTERNALS
1515

1616

17+
include::{root-partials}_block-caveats.adoc[tag="N1QL-SQL"]
18+
1719
// == Introduction
1820

19-
There are several minor but notable behavior differences between _N1QL for Mobile_ queries and _N1QL for Server_, as shown in <<tbl-diffs>>.
21+
There are several minor but notable behavior differences between _{sqlpp} for Mobile_ queries and _{sqlpp} for Server_, as shown in <<tbl-diffs>>.
2022

21-
In some instances, if required, you can force N1QL for Mobile to work in the same way as N1QL for Server.
23+
In some instances, if required, you can force {sqlpp} for Mobile to work in the same way as {sqlpp} for Server.
2224
These instances are noted in the content below.
2325

24-
.N1QL Query Comparison
26+
.{sqlpp} Query Comparison
2527
[#tbl-diffs, cols="^1,2a,2a, options="header"]
2628
|===
2729

2830
|
29-
2+^h|N1QL Comparison
31+
2+^h|{sqlpp} Comparison
3032

3133
h| Feature
32-
h| N1QL for Couchbase Server
33-
h| N1QL for Mobile
34+
h| {sqlpp} for Couchbase Server
35+
h| {sqlpp} for Mobile
3436

3537
| USE KEYS
3638
| SELECT fname, email FROM tutorial USE KEYS ["dave", "ian"];
@@ -85,7 +87,7 @@ ON KEYS ARRAY s.order_id FOR s IN u.order_history END;
8587
| Only scalar values may be compared
8688

8789
| ORDER BY
88-
|Result sequencing is based on specific rules described in {svr-n1ql-reference-orderby--xref}
90+
|Result sequencing is based on specific rules described in {svr-{sqlpp}-reference-orderby--xref}
8991
|Result sequencing is based on the SQLite ordering described in https://sqlite.org/lang_select.html[SQLite select overview]
9092

9193
The ordering of _Dictionary_ and _Array_ objects is based on binary ordering.
@@ -108,7 +110,7 @@ The ordering of _Dictionary_ and _Array_ objects is based on binary ordering.
108110

109111
[,cols="1a,1a", options="header"]
110112
|===
111-
^| N1QL for Couchbase Server ^| N1QL for Mobile
113+
^| {sqlpp} for Couchbase Server ^| {sqlpp} for Mobile
112114

113115

114116
|Couchbase Server operates in the same way as Couchbase Lite, except:
@@ -118,9 +120,9 @@ The ordering of _Dictionary_ and _Array_ objects is based on binary ordering.
118120
* Empty strings, arrays, and objects are FALSE
119121
* All other values are TRUE
120122

121-
You can choose to use _Couchbase Server's N1QL rules_ by using the `TOBOOLEAN(expr)` function to convert a value to its boolean value.
123+
You can choose to use _Couchbase Server's {sqlpp} rules_ by using the `TOBOOLEAN(expr)` function to convert a value to its boolean value.
122124

123-
|N1QL for Mobile's boolean logic rules are based on SQLite’s, so:
125+
|{sqlpp} for Mobile's boolean logic rules are based on SQLite’s, so:
124126

125127
* TRUE is TRUE, and FALSE is FALSE
126128
* Numbers 0 or 0.0 are FALSE
@@ -134,11 +136,11 @@ You can choose to use _Couchbase Server's N1QL rules_ by using the `TOBOOLEAN(ex
134136

135137
=== Logical Operations
136138

137-
In N1QL for Mobile logical operations will return one of three possible values; `TRUE`, `FALSE`, or `MISSING`.
139+
In {sqlpp} for Mobile logical operations will return one of three possible values; `TRUE`, `FALSE`, or `MISSING`.
138140

139141
Logical operations with the `MISSING` value could result in `TRUE` or `FALSE` if the result can be determined regardless of the missing value, otherwise the result will be `MISSING`.
140142

141-
In N1QL for Mobile -- unlike N1QL for Server -- `NULL` is implicitly converted to `FALSE` before evaluating logical operations.
143+
In {sqlpp} for Mobile -- unlike {sqlpp} for Server -- `NULL` is implicitly converted to `FALSE` before evaluating logical operations.
142144
<<tbl-logops>> summarizes the result of logical operations with different operand values and also shows where the Couchbase Server behavior differs.
143145

144146
.Logical Operations Comparison
@@ -147,8 +149,8 @@ In N1QL for Mobile -- unlike N1QL for Server -- `NULL` is implicitly converted t
147149

148150
.2+.>h| Operand +
149151
a
150-
3+h| N1QL for Mobile
151-
3+h| N1QL for Server
152+
3+h| {sqlpp} for Mobile
153+
3+h| {sqlpp} for Server
152154

153155
h| b
154156
h| a AND b
@@ -296,21 +298,21 @@ h| a OR b
296298
|===
297299

298300
== CRUD Operations
299-
N1QL for Mobile only supports Read or Query operations.
301+
{sqlpp} for Mobile only supports Read or Query operations.
300302

301-
N1QL for Server fully supports CRUD operation.
303+
{sqlpp} for Server fully supports CRUD operation.
302304

303305
== Functions
304306

305307
=== Division Operator
306308

307309
[,colse="1a,1a", options="header"]
308310
|===
309-
^| N1QL for Server ^| N1QL for Mobile
311+
^| {sqlpp} for Server ^| {sqlpp} for Mobile
310312

311-
| N1QL for Server always performs float division regardless of the types of the operands.
313+
| {sqlpp} for Server always performs float division regardless of the types of the operands.
312314

313-
You can force this behavior in N1QL for Mobile by using the `DIV(x, y)` function.
315+
You can force this behavior in {sqlpp} for Mobile by using the `DIV(x, y)` function.
314316

315317
|The operand types determine the
316318
division operation performed. +
@@ -322,9 +324,9 @@ If one is a floating number, then float division is used.
322324
=== Round Function
323325
[,cols="1a,1a", options="header"]
324326
|===
325-
^| N1QL for Server ^| N1QL for Mobile
327+
^| {sqlpp} for Server ^| {sqlpp} for Mobile
326328

327-
| N1QL for Server `ROUND()` uses the _Rounding to Nearest Even_ convention (for example, `ROUND(1.85)` returns 1.8).
329+
| {sqlpp} for Server `ROUND()` uses the _Rounding to Nearest Even_ convention (for example, `ROUND(1.85)` returns 1.8).
328330

329331
You can force this behavior in Couchbase Lite by using the `ROUND_EVEN()` function.
330332

@@ -337,4 +339,4 @@ You can force this behavior in Couchbase Lite by using the `ROUND_EVEN()` functi
337339

338340

339341

340-
// END --- inclusion -- common-query-n1ql-mobile.adoc
342+
// END --- inclusion -- common-query-{sqlpp}-mobile.adoc

modules/ROOT/pages/_partials/commons/common-query-n1ql-mobile.adoc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
:count-result-text: The result set representing a count is a key-value pair. The key being the count name, as defined using `SelectResult.as`
1818

19-
include::{root-partials}_block-caveats.adoc[tags="code-disclaimer"]
19+
include::{root-partials}_block-caveats.adoc[tag="N1QL-SQL"]
2020

2121
// END::Local page attributes
2222

@@ -25,18 +25,18 @@ NOTE: The examples used in this topic are based on the _Travel Sample_ app and d
2525

2626
== Introduction
2727

28-
Developers using Couchbase Lite for {param-title} can provide N1QL query strings using the N1QL Query API.
28+
Developers using Couchbase Lite for {param-title} can provide {sqlpp} query strings using the {sqlpp} Query API.
2929
This API uses query statements of the form shown in <<ex-query-form>>.
3030

31-
The structure and semantics of the query format are based on that of Couchbase Server's N1QL query language -- see {svr-n1ql-reference--xref} and {svr-n1ql-datamodel--xref}.
31+
The structure and semantics of the query format are based on that of Couchbase Server's {sqlpp} query language -- see {svr-n1ql-reference--xref} and {svr-n1ql-datamodel--xref}.
3232

3333

3434
== Running
3535

36-
Use the N1QLQuery class to define the N1QL query string on the database to be queried.
36+
Use the N1QLQuery class to define the {sqlpp} query string on the database to be queried.
3737
Then run the query using the`.execute()` method -- see {query-resultsets--xref} for how to work with result sets.
3838

39-
.Running a N1QL Query
39+
.Running a {sqlpp} Query
4040
[#ex-samplerun]
4141
:param-tags: query-syntax-n1ql
4242
include::partial$_block_tabbed_code_example.adoc[]
@@ -76,7 +76,7 @@ The `SELECT`ed properties of documents matching this criteria will be returned i
7676
<.> <<lbl-offset>> specifies the number of results to be skipped before starting to return results
7777
====
7878

79-
TIP: We recommend working through the {url-n1ql-tutorial} as a good way to build your N1QL skills.
79+
TIP: We recommend working through the {url-n1ql-tutorial} as a good way to build your {sqlpp} skills.
8080

8181

8282

@@ -118,12 +118,12 @@ You can use the wildcard *** to select all columns -- see <<Select Wildcard>>
118118
<.> Use the optional `AS` argument to provides an alias name for a property. Each property can be aliased by putting the `AS <alias name>` after the column name.
119119

120120
==== Select Wildcard
121-
When using the `SELECT *` option the column name (key) of the N1QL string is one of:
121+
When using the `SELECT *` option the column name (key) of the {sqlpp} string is one of:
122122

123123
* The alias name if one was specified
124124
* The data source name (or its alias if provided) as specified in the `FROM` clause.
125125

126-
This behavior is inline with that of Couchbase Server N1QL -- see example in <<tbl-selstar>>.
126+
This behavior is inline with that of Couchbase Server {sqlpp} -- see example in <<tbl-selstar>>.
127127

128128

129129
.Example Column Names for SELECT ***
@@ -1126,7 +1126,7 @@ This is different from Server N1QL, where:
11261126
* Empty strings, arrays, and objects are FALSE
11271127
* All other values are TRUE
11281128

1129-
TIP: Use TOBOOLEAN(expr) function to convert a value based on Server N1QL boolean value rules,
1129+
TIP: Use TOBOOLEAN(expr) function to convert a value based on Server {sqlpp} boolean value rules,
11301130
--
11311131

11321132
.Logical Operators
@@ -1244,7 +1244,7 @@ If an operand is NULL, the operation will result in NULL if the other operand is
12441244
|===
12451245

12461246
[NOTE]
1247-
This differs from Server N1QL in the following instances: +
1247+
This differs from Server {sqlpp} in the following instances: +
12481248
^5-1^ Server will return: NULL instead of FALSE +
12491249
^5-2^ Server will return: MISSING instead of FALSE +
12501250
^5-3^ Server will return: NULL instead of MISSING +
@@ -1743,7 +1743,7 @@ The function uses _Rounding to Nearest Even_ (Banker’s Rounding) convention wh
17431743

17441744
|===
17451745

1746-
^*^ The behavior of the ROUND() function is different from Server N1QL ROUND(), which rounds the midpoint values using _Rounding to Nearest Even_ convention.
1746+
^*^ The behavior of the ROUND() function is different from Server {sqlpp} ROUND(), which rounds the midpoint values using _Rounding to Nearest Even_ convention.
17471747

17481748

17491749

@@ -1952,7 +1952,7 @@ ifndef::is-c[]
19521952
// Section not valid for C
19531953
== QueryBuilder Differences
19541954

1955-
Couchbase Lite N1QL Query supports all QueryBuilder features, except _Predictive Query_ and _Index_. See <<tbl-qbldr-diffs>> for the features supported by N1QL but not by QueryBuilder.
1955+
Couchbase Lite {sqlpp} Query supports all QueryBuilder features, except _Predictive Query_ and _Index_. See <<tbl-qbldr-diffs>> for the features supported by {sqlpp} but not by QueryBuilder.
19561956

19571957

19581958
.QueryBuilder Differences
@@ -2013,11 +2013,11 @@ endif::is-c[]
20132013
[#lbl-query-params]
20142014
== Query Parameters
20152015

2016-
You can provide runtime parameters to your N1QL query to make it more flexible.
2016+
You can provide runtime parameters to your {sqlpp} query to make it more flexible.
20172017

20182018
To specify substitutable parameters within your query string prefix the name with *`$`*, `$type` -- see: <<ex-sample-params>>.
20192019

2020-
.Running a N1QL Query
2020+
.Running a {sqlpp} Query
20212021
[#ex-sample-params]
20222022
:param-tags: query-syntax-n1ql-params
20232023
include::partial$_block_tabbed_code_example.adoc[]

0 commit comments

Comments
 (0)