diff --git a/.github/workflows/check_pr_title.yml b/.github/workflows/check_pr_title.yml deleted file mode 100644 index 9b03123..0000000 --- a/.github/workflows/check_pr_title.yml +++ /dev/null @@ -1,34 +0,0 @@ -# DON'T MODIFY THIS WORKFLOW FILE DIRECTLY -# -# This workflow -# - checks if the PR title is compliant -# (cf. https://doctolib.atlassian.net/wiki/spaces/EE/pages/1793131314/How+to+have+a+good+PR+title) -# - is force implemented in specific repositories (tier0 repository) of the organization with Terraform -# - is mandatory to merge in main branch of your repo because of -# https://github.com/doctolib/kube/blob/master/envs/tooling/terraform/05_github/main_rulesets.tf#L1 -# -# For more details, read https://doctolib.atlassian.net/wiki/spaces/EE/pages/1793590015/Traceability+and+risk+assessment+for+production+changes - -name: '[Org workflow] Check PR title' -run-name: '${{ github.event.pull_request.title }}' - -on: - pull_request: - branches: [master, main, staging] - types: [opened, edited, reopened, synchronize, ready_for_review] - merge_group: - -permissions: - pull-requests: write - statuses: write - repository-projects: read - actions: read - -jobs: - check_pr_title: - name: Check PR title - if: '!github.event.pull_request.draft' - runs-on: ubuntu-latest - steps: - - name: Check PR title - uses: doctolib/actions/check-pr-title@main diff --git a/src/database.rs b/src/database.rs index 7ad40e1..634f04f 100644 --- a/src/database.rs +++ b/src/database.rs @@ -482,6 +482,19 @@ impl Database { }) } + pub fn default_collection_or_error(&self) -> Result { + let mut error = CBLError::default(); + let collection = unsafe { CBLDatabase_DefaultCollection(self.get_ref(), &mut error) }; + + check_error(&error)?; + + if collection.is_null() { + Err(Error::cbl_error(CouchbaseLiteError::NotFound)) + } else { + Ok(Collection::retain(collection)) + } + } + //////// NOTIFICATIONS: /** Registers a database change listener function. It will be called after one or more diff --git a/src/replicator.rs b/src/replicator.rs index 19cd64a..61effe0 100644 --- a/src/replicator.rs +++ b/src/replicator.rs @@ -641,20 +641,11 @@ pub extern "C" fn c_collection_property_decryptor( #[derive(Default)] pub struct ReplicationConfigurationContext { - #[deprecated(note = "please use `collection.push_filter` on default collection instead")] - pub push_filter: Option, - #[deprecated(note = "please use `collection.pull_filter` on default collection instead")] - pub pull_filter: Option, - #[deprecated(note = "please use `collection.conflict_resolver` on default collection instead")] - pub conflict_resolver: Option, - #[deprecated( - note = "please use `collection_property_encryptor` on default collection instead" - )] - pub default_collection_property_encryptor: Option, - #[deprecated( - note = "please use `collection_property_decryptor` on default collection instead" - )] - pub default_collection_property_decryptor: Option, + pub push_filter: Option, // TODO: deprecated + pub pull_filter: Option, // TODO: deprecated + pub conflict_resolver: Option, // TODO: deprecated + pub default_collection_property_encryptor: Option, // TODO: deprecated + pub default_collection_property_decryptor: Option, // TODO: deprecated pub collection_property_encryptor: Option, pub collection_property_decryptor: Option, } @@ -692,11 +683,11 @@ impl ReplicationCollection { /** The configuration of a replicator. */ pub struct ReplicatorConfiguration { - #[deprecated(note = "use collections instead")] + // TODO: deprecated pub database: Option, // The database to replicate. When setting the database, ONLY the default collection will be used for replication. - pub endpoint: Endpoint, // The address of the other database to replicate with + pub endpoint: Endpoint, // The address of the other database to replicate with pub replicator_type: ReplicatorType, // Push, pull or both - pub continuous: bool, // Continuous replication? + pub continuous: bool, // Continuous replication? //-- Auto Purge: /** If auto purge is active, then the library will automatically purge any documents that the replicating @@ -721,9 +712,9 @@ pub struct ReplicatorConfiguration { pub pinned_server_certificate: Option>, // An X.509 cert to "pin" TLS connections to (PEM or DER) pub trusted_root_certificates: Option>, // Set of anchor certs (PEM format) //-- Filtering: - #[deprecated(note = "please use `collection.channels` on default collection instead")] + // TODO: deprecated pub channels: MutableArray, // Optional set of channels to pull from - #[deprecated(note = "please use `collection.document_ids` on default collection instead")] + // TODO: deprecated pub document_ids: MutableArray, // Optional set of document IDs to replicate pub collections: Option>, // The collections to replicate with the target's endpoint (Required if the database is not set). //-- Advanced HTTP settings: