Skip to content

Commit c806bc6

Browse files
committed
initial check-in of sync code before adding replication (copy from query base)
1 parent 0d6b79f commit c806bc6

File tree

91 files changed

+4235
-0
lines changed

Some content is hidden

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

91 files changed

+4235
-0
lines changed

.gitignore

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
## Build generated
2+
build/
3+
DerivedData/
4+
iOS/
5+
macOS/
6+
7+
## Various settings
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata/
17+
18+
## Other
19+
*.moved-aside
20+
*.xccheckout
21+
*.xcscmblueprint
22+
23+
### Xcode Patch ###
24+
*.xcodeproj/*
25+
!*.xcodeproj/project.pbxproj
26+
!*.xcodeproj/xcshareddata/
27+
!*.xcworkspace/contents.xcworkspacedata
28+
/*.gcno
29+
30+
#Mac OS
31+
# General
32+
.DS_Store
33+
.AppleDouble
34+
.LSOverride
35+
36+
# Icon must end with two \r
37+
Icon
38+
39+
# Thumbnails
40+
._*
41+
42+
# Files that might appear in the root of a volume
43+
.DocumentRevisions-V100
44+
.fseventsd
45+
.Spotlight-V100
46+
.TemporaryItems
47+
.Trashes
48+
.VolumeIcon.icns
49+
.com.apple.timemachine.donotpresent
50+
51+
# Directories potentially created on remote AFP share
52+
.AppleDB
53+
.AppleDesktop
54+
Network Trash Folder
55+
Temporary Items
56+
.apdisk

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Quickstart in Couchbase Lite Query with Swift and UIKit
2+
#### Build an iOS App in Swift with Couchbase Lite
3+
4+
> This repo is designed to show you an app that allows users to log in and make changes to their user profile information. User profile information is persisted as a Document in the local Couchbase Lite Database. When the user logs out and logs back in again, the profile information is loaded from the Database. This app also demostrates how you can bundle, load, and use a `prebuilt` instance of Couchbase Lite and introduces you to the basics of the `QueryBuilder` interface.
5+
6+
Full documentation can be found on the [Couchbase Developer Portal](https://developer.couchbase.com/tutorial-quickstart-ios-uikit-query).
7+
8+
9+
## Prerequisites
10+
To run this prebuilt project, you will need:
11+
12+
- Mac running MacOS 11 or 12
13+
- Xcode 12/13 - Download latest version from the <a target="_blank" rel="noopener noreferrer" href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12">Mac App Store</a> or via <a target="_blank" rel="noopener noreferrer" href="https://github.com/RobotsAndPencils/XcodesApp">Xcodes</a>
14+
15+
> **Note**: If you are using an older version of Xcode, which you need to retain for other development needs, make a copy of your existing version of Xcode and install the latest Xcode version. That way you can have multiple versions of Xcode on your Mac. More information can be found in [Apple's Developer Documentation](https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-I_HAVE_MULTIPLE_VERSIONS_OF_XCODE_INSTALLED_ON_MY_MACHINE__WHAT_VERSION_OF_XCODE_DO_THE_COMMAND_LINE_TOOLS_CURRENTLY_USE_)
16+
>
17+
### Installing Couchbase Lite Framework
18+
19+
The [Couchbase Documentation](https://docs.couchbase.com/couchbase-lite/3.0/swift/gs-install.html) has examples on how to add Couchbase Lite via
20+
- Swift Package Manager
21+
- Cocoa Pods
22+
- Carthage
23+
- Direct Download
24+
25+
## App Architecture
26+
27+
The sample app follows the [MVP pattern](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter), separating the internal data model, from a passive view through a presenter that handles the logic of our application and acts as the conduit between the model and the view
28+
29+
## Try it out
30+
31+
* Open `src/UserProfileQueryDemo.xcodeproj` using Xcode
32+
* Build and run the project.
33+
* Verify that you see the login screen.
34+
35+
## Conclusion
36+
37+
This tutorial walked you through an example of how to use a pre-built Couchbase Lite database and has a simple Query example to show you how to use the `QueryBuilder` API in Swift.

src/LICENSE.txt

+741
Large diffs are not rendered by default.

src/Tools/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Couchbase Lite (-Core) Utility Tools
2+
3+
These are command-line tools intended to help developers working with Couchbase Lite databases. They are self-contained and can be run from anywhere.
4+
5+
Each tool has a small amount of online help that can be accessed by running it either with no arguments, or with just a `--help` flag.
6+
7+
**Compatibility:**
8+
9+
* Each tool is self-contained, with its own embedded LiteCore library. This means it's important to upgrade the tools when you upgrade Couchbase Lite, since an older tool may not be able to read a newer database.
10+
* The tools can operate on databases created on any platform, as long as they're accessible through the filesystem. So for instance, you can copy a database from an Android app to an SD card, mount it on a Mac, and run the tool there.
11+
* The tools are not compatible with Couchbase Lite 1.x databases.
12+
13+
## cblite
14+
15+
A multipurpose tool for examining and querying a database. It has a number of subcommands, of which the most generally useful are:
16+
17+
* `ls`: Lists the document IDs
18+
* `cat`: Displays documents as pretty-printed JSON
19+
* `query`: Runs a query, expressed in low-level [JSON format](https://github.com/couchbase/couchbase-lite-core/wiki/JSON-Query-Schema) (sorry, no N1QL parser!)
20+
21+
It can be run in an interactive mode by giving a database path but no subcommand. This lets you run multiple commands without having to re-enter the database name every time.
22+
23+
## litecp
24+
25+
A document-copying tool that can:
26+
27+
* Create a database from one or more JSON files
28+
* Import JSON file(s) into an existing database as documents
29+
* Export a database's documents into a JSON file or files
30+
* Push-replicate one local database file to another one
31+
* Push or pull from a remote database
32+
33+
## litecorelog
34+
35+
Reads a binary log file produced by `c4log_writeToBinaryFile`, and outputs it as plain text.

src/Tools/cblite

3.4 MB
Binary file not shown.

src/Tools/litecorelog

64.3 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"object": {
3+
"pins": [
4+
{
5+
"package": "CouchbaseLiteSwift",
6+
"repositoryURL": "https://github.com/couchbase/couchbase-lite-swift-ee.git",
7+
"state": {
8+
"branch": null,
9+
"revision": "25469e9284d810b72af88bfaebc54e24b2fcf46e",
10+
"version": "3.0.0-beta02"
11+
}
12+
}
13+
]
14+
},
15+
"version": 1
16+
}

0 commit comments

Comments
 (0)