Skip to content

DOC-8132-C2-GS -- C Lang Get Started #490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ modules/android/examples/docsnippets/**
modules/android/examples/jsonsnippets/**
temp-bin/**

tempbin/**
tempbin/**
1 change: 1 addition & 0 deletions antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ nav:
- modules/swift/nav-swift.adoc
- modules/ROOT/nav-javascript.adoc
- modules/ROOT/nav-sync-gateway.adoc
:prerelease: BETA
22 changes: 20 additions & 2 deletions modules/ROOT/pages/_partials/_block-caveats.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

// BEGIN ANDROID-CONSTRAINTS

// tag::android-constraints[]

.Android enablers
[CAUTION]

--
Allow Unencrypted Network Traffic::
// tag::android-manifest-cleartext[]
Expand All @@ -12,11 +17,16 @@ Use Background Threads::
// tag::android-threads[]
As with any network or file I/O activity, CouchbaseLite activities should not be performed on the UI thread.
*Always* use a *background* thread.

// end::android-threads[]

--

// end::android-constraints[]
// END ANDROID-CONSTRAINTS


// BEGIN IOS-CONSTRAINTS

// tag::ios-constraints[]
.iOS Restrictions
Expand All @@ -28,14 +38,22 @@ You can customize the message presented to the user by editing the description f
--

// end::ios-constraints[]
// END IOS-CONSTRAINTS

// BEGIN -- BETA DISCLAIMER
// tag::not-beta[]
CAUTION: Not available in BETA release

// end::not-beta[]
// END -- BETA DISCLAIMER


// tag::code-disclaimer[]

.Code Snippets
[NOTE]
The code examples are indicative only.
They demonstrate basic concepts and approaches to using a feature.
All code examples are indicative only.
They demonstrate the basic concepts and approaches to using a feature.
Use them as inspiration and adapt these examples to best practice when developing applications for your platform.

// end::code-disclaimer[]
Expand Down
52 changes: 52 additions & 0 deletions modules/ROOT/pages/_partials/_get-started-topic-group.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// BEGIN -- inclusion -- _gs-topic-group.adoc
// Purpose: Show the topic group, allowing easy cycle-through
// Do not show current page as a click-through though
// Parameter: The current page name
// Container: /modules/ROOT/pages/_partials/_gs-topic-group.adoc

// Begin -Local Attributes
:this-page: {param-page}

// ifeval::["{this-page}"=="{introduction--page}"]
// :is-intro: Introduction
// endif::[]

// ifeval::["{this-page}"=="{gs-prereqs--page}"]
// :is-prereqs: Prepare
// endif::[]

ifeval::["{this-page}"=="{gs-install--page}"]
:is-install: Install
endif::[]

ifeval::["{this-page}"=="{gs-build--page}"]
:is-build: Build
endif::[]
// End -Local Attributes

// Begin -- Output Block
Steps in Getting Started::
// ifdef::is-intro[*{is-intro}*]
// ifndef::is-intro[{introduction--xref}]
// |
// ifdef::is-prereqs[*{is-prereqs}*]
// ifndef::is-prereqs[{gs-prereqs--xref}]
// |
ifdef::is-install[*{is-install}*]
ifndef::is-install[{gs-install--xref}]
|
ifdef::is-build[*{is-build}*]
ifndef::is-build[{gs-build--xref}]
// End -- Output Block


// Begin -- Tidy-up
:is-intro!:
:is-prereqs!:
:is-install!:
:is-build!:
:this-page!:
:param-page!:
// End -- Tidy-up

// END -- inclusion -- _gs-topic-group.adoc
4 changes: 2 additions & 2 deletions modules/ROOT/pages/_partials/_related-content.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ Blog Entries
// end::references-prod[]
// prod related
// tag::how-query[]
* {querybuilder--xref}
ifndef::is-clang[* {querybuilder--xref}]
* {querybuilder-n1ql--xref}
* {query-live--xref}
* {querybuilder--xref--predictive-query}
* {fts--xref}

// end::how-query[]
Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/_partials/authentication.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This is the recommended way of using basic authentication.
.Basic Authentication
[#ex-base-auth]
:param-tags: basic-authentication
include::{root-partials}_block_show_snippet.adoc[]
include::{root-partials}_block_tabbed_code_example.adoc[]
:param-tags!:


Expand All @@ -44,5 +44,5 @@ The HTTP response contains a session ID which can then be used to authenticate a
.Session Authentication
[#ex-session-auth]
:param-tags: session-authentication
include::{root-partials}_block_show_snippet.adoc[]
include::{root-partials}_block_tabbed_code_example.adoc[]
:param-tags!:
40 changes: 20 additions & 20 deletions modules/ROOT/pages/_partials/commons/common-querybuilder-n1ql.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:menuitem-delimiter: {nbsp}{nbsp}|{nbsp}{nbsp}
: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`


include::_block-caveats.adoc[tags="code-disclaimer"]

// END::Local page attributes

Expand Down Expand Up @@ -63,7 +63,7 @@ TIP: We recommend working through the {url-n1ql-tutorial} as a good way to build
Use the N1QLQuery class to define the N1QL query string on the database to be queried.
Then run the query using the`.execute()` method -- see

The result set produced by N1QL and {querybuilder--xref)} queries is the same -- see {query-resultsets--xref}.
The result set produced by N1QL and {querybuilder--xref} queries is the same -- see {query-resultsets--xref}.


.Running a N1QL Query
Expand Down Expand Up @@ -155,8 +155,9 @@ FROM dataSource <.>

=== Arguments

<.> `dataSource` -- this is the database name against which the query is to run.
Use `AS` to give the database an alias you can use within the query.
<.> Here `dataSource` is the database name against which the query is to run.
Use `AS` to give the database an alias you can use within the query. +
To use the current database, without specifying a name, use `_` as the datasource.

<.> `JOIN joinclause` -- use this optional argument to link datasources -- see <<lbl-join>>

Expand All @@ -169,6 +170,9 @@ Use `AS` to give the database an alias you can use within the query.
SELECT name FROM db
SELECT store.name FROM db AS store
SELECT store.name FROM db store
SELECT name FROM _
SELECT store.name FROM _ AS store
SELECT store.name FROM _ store
----

====
Expand Down Expand Up @@ -543,6 +547,7 @@ SELECT firstName, lastName FROM db WHERE middleName IS NULL

===== Purpose
The MISSING literal represents a missing name-value pair in a document.

===== Syntax

[source,sql]
Expand Down Expand Up @@ -572,9 +577,9 @@ arrayLiteral = '[' _ (expression ( _ ',' _ e2:expression )* )? ']'
===== Example
[source,sql]
----
SELECT [“a”, “b”, “c”] FROM db
SELECT [ property1, property2, property3] FROM db
SELECT * FROM db WHERE name IN [“James”, “John”, “Jack”
SELECT [“a”, “b”, “c”] FROM _
SELECT [ property1, property2, property3] FROM _
SELECT * FROM _ WHERE name IN [“James”, “John”, “Jack”]
----

[#lbl-lit-dict]
Expand Down Expand Up @@ -631,7 +636,7 @@ TIP: To use other characters in the identifier, surround the identifier with the

[source, sql]
----
SELECT * FROM db
SELECT * FROM _

SELECT * FROM `db-1` <.>

Expand Down Expand Up @@ -714,7 +719,7 @@ Evaluates expressions over items in an array object.
----
arrayExpression = <.>
anyEvery _ variableName <.>
_ IN <.> _ expression <.>
_ IN _ expression <.>
_ SATISFIES _ expression <.>
END <.>

Expand Down Expand Up @@ -958,22 +963,22 @@ WHERE v1 <> v2
a|String wildcard pattern matching ^2^ comparison.
Two wildcards are supported:

`%` Matches zero or more characters. +
`_` Matches a single character.
* `%` Matches zero or more characters. +
* `_` Matches a single character.


|WHERE name LIKE ‘a%’ +
WHERE name LIKE ‘%a’ +
WHERE name LIKE ‘%or% +
WHERE name LIKE ‘a%o%’ +
WHERE name LIKE ‘%_r%’ +
WHERE name LIKE ‘%\_r%’ +
WHERE name LIKE ‘%a_%’ +
WHERE name LIKE ‘%a__%’ +
WHERE name LIKE ‘aldo’


|MATCH
|String matching using FTS see <<lbl-ops-match>>
|String matching using FTS see <<lbl-func-fts>>
|WHERE v1-index MATCH "value"

|BETWEEN
Expand Down Expand Up @@ -1007,7 +1012,7 @@ WHERE name LIKE ‘aldo’

|===

^2^ Matching is case-insensitive for ASCII characters, case-sensitive for non-ASCII (default).
^2^ Matching is case-insensitive for ASCII characters, case-sensitive for non-ASCII.


^3^ Use of `IS` and `IS NOT` is limited to comparing `NULL` and `MISSING` values (this encompasses `VALUED`).
Expand Down Expand Up @@ -1627,7 +1632,7 @@ Returns `NULL` if either or both expressions are `NULL`.+
|Returns the arctangent in radians.

|ATAN2(expr1,expr2)
|Returns the arctangent of expr2/expr1.
|Returns the arctangent of expr1/expr2.

|CEIL(expr)
|Returns the smallest integer not less than the number.
Expand All @@ -1640,11 +1645,6 @@ Returns `NULL` if either or both expressions are `NULL`.+
Both expr1 and expr2 are cast to a double number before division. +
The returned result is always a double.

|IDIV(expr1, expr2)
|Returns integer division of expr1 and expr2. +
Both expr1 and expr2 are cast to an integer number before division. +
The returned result is always an integer.

|DEGREES(expr)
|Converts radians to degrees.

Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/_partials/database-encryption.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Provide this encryption key every time the database is opened -- see <<ex-sdb-en
.Database Encryption
[#ex-sdb-encrypt]
:param-tags: database-encryption
include::{root-partials}_block_show_snippet.adoc[]
include::{root-partials}_block_tabbed_code_example.adoc[]
:param-tags!:


Expand Down
1 change: 1 addition & 0 deletions modules/ROOT/pages/_partials/nav-skeleton-start-clang.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.xref:couchbase-lite:clang:quickstart.adoc[{param-title}]
// tag::get-started[]
* xref:{cbl-pg-prereqs}[Start Here!]
.Start Here!
// tag::start[]
** {gs-install--xref}
// end::start[]
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/_partials/nav-skeleton.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include::{root-partials}nav-skeleton-start-{param-module}.adoc[]
// end::data-model[]
// tag::query[]
* Queries
** {querybuilder--xref}
ifndef::is-clang[** {querybuilder--xref}]
** {querybuilder-n1ql--xref}
** {query-resultsets--xref}
** {query-live--xref}
Expand Down
6 changes: 3 additions & 3 deletions modules/ROOT/pages/_partials/quickstart-skeleton.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ image::ROOT:manage-and-store-data-locally.svg[,250]
====== {empty}
[.content]
.Do More
* {xref-cbl-pg-replication}
* {querybuilder--xref}
* {cbl--xref}{replication--page}[Data Sync]
* {querybuilder-n1ql--xref}
ifndef::is-clang[* {querybuilder--xref}]
* {query-live--xref}
* {querybuilder--xref--predictive-query}

[.column]
====== {empty}
Expand Down
3 changes: 3 additions & 0 deletions modules/clang/pages/blob.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ include::partial$_std-cbl-hdr-clang.adoc[]
// :param-module: {lang-mod-clang}

include::{root-commons}blob.adoc[]


include::{root-partials}block-related-content-data.adoc[]
22 changes: 3 additions & 19 deletions modules/clang/pages/dep-upgrade.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
= Upgrade Couchbase Lite
= Upgrade Couchbase Lite for C
:page-aliases: advance/clang-dep-upgrade.adoc
:page-layout: article
:page-status:
:page-edition:
:page-role:
:description: Couchbase mobile database certificate pinning
:description: Couchbase mobile database upgrading

include::partial$_std-cbl-hdr-android.adoc[]
include::partial$_std-cbl-hdr-clang.adoc[]

// BEGIN::Local page attributes
:blank-field: ____
Expand All @@ -22,18 +18,6 @@ include::partial$_std-cbl-hdr-android.adoc[]
[abstract]
{description}

== Xcode

The API has changed in Couchbase Lite 2.0 and will require porting an application that is using Couchbase Lite 1.x API to the Couchbase Lite 2.0 API.
To update an Xcode project built with Couchbase Lite 1.x:

* Remove the existing *CouchbaseLite.framework* dependency from the Xcode project.
* Remove all the Couchbase Lite 1.x dependencies (see the https://docs-archive.couchbase.com/couchbase-lite/1.4/clang.html#getting-started[1.x installation guide]).
* Install the Couchbase Lite 2.0 framework in your project -- see {gs-install--xref}.
At this point, there will be many compiler warnings.
Refer to the examples on this page to learn about the new API.
* Build & run your application.

== Database Upgrade

Databases that were created with Couchbase Lite 1.2 or later can be used with Couchbase Lite 2.0.
Expand Down
2 changes: 1 addition & 1 deletion modules/clang/pages/document.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ include::{root-commons}document.adoc[]

// include::{root-commons}reserved-keys-list.adoc[]

// include::{root-partials}block-related-content-data.adoc[]
include::{root-partials}block-related-content-data.adoc[]
Loading