I am very new to Realm. I am using Realm C++ SDK to make a sample database that can sync with MongoDB Atlas.
As a summary of what I did,
- I built the Realm C++ SDK (this github issue shows how I built the SDK)
- I made a Realm app on MongoDB Atlas
- I pulled the Realm app
MyRealmApp
from terminal usingrealm-cli
, from directoryrealm_test
- I made modification on the
realm_test/MyRealmApp/auth/providers.json
andrealm_test/MyRealmApp/sync/config.json
to fulfill the prerequisites
After building the SDK following the documentation, and creating an app that fulfills the prerequisites, this is the resulting project file structure.
.realm_test
├──build
| ├── ... //everything inside 'build' is generated by CMakeLists.txt
|
├──CMakeLists.txt //this file builds the SDK
|
├──main.cpp //this is the test code I used when building the SDK
|
├──MyRealmApp //this is the app I created after building the SDK, everything under this is generated, with some modification
| |
| ├──auth
| | ├──custom_user_data.json
| | ├──providers.json
| |
| ├──data_sources
| | ├──mongodb-atlas
| | ├──config.json
| |
| ├──environments
| | ├──development.json
| | ├──no-environment.json
| | ├──production.json
| | ├──qa.json
| | ├──testing.json
| |
| ├──functions
| | ├──config.json
| |
| ├──graphql
| | ├──custom_resovlers
| | ├──config.json
| |
| ├──http_endpoints
| | ├──config.json
| |
| ├──log_forwarders
| |
| ├──services
| |
| ├──sync
| | ├──config.json
| |
| ├──values
|
├──realm_config.json
The next step is, I want to access and use the DB through C++ codes, as in the quick start.
My question is,
- Is my current project file structure correct?
- Where should I put the C++ source codes?
- How to build and run the Realm project?
- Do I need to remove the
./realm_test/build
, modify the CMakeLists.txt and runcmake
again? - If I need to modify the CMakeLists.txt, which part do I need to modify? (I am also new to CMake)
- Do I need to remove the
*this question is a copy of this stackoverflow question.