cloud-dog-db 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cloud_dog_db-0.3.1/.docs-manifest.yml +6 -0
- cloud_dog_db-0.3.1/.gitignore +1 -0
- cloud_dog_db-0.3.1/:memory: +0 -0
- cloud_dog_db-0.3.1/ARCHITECTURE.md +46 -0
- cloud_dog_db-0.3.1/BUILD.md +50 -0
- cloud_dog_db-0.3.1/CHANGELOG.md +30 -0
- cloud_dog_db-0.3.1/DATA-MODEL.md +33 -0
- cloud_dog_db-0.3.1/LICENCE +190 -0
- cloud_dog_db-0.3.1/LICENSE +176 -0
- cloud_dog_db-0.3.1/NOTICE +7 -0
- cloud_dog_db-0.3.1/PKG-INFO +58 -0
- cloud_dog_db-0.3.1/README.md +48 -0
- cloud_dog_db-0.3.1/REQUIREMENTS.md +43 -0
- cloud_dog_db-0.3.1/TESTS.md +43 -0
- cloud_dog_db-0.3.1/cloud_dog_db/__init__.py +66 -0
- cloud_dog_db-0.3.1/cloud_dog_db/config/__init__.py +0 -0
- cloud_dog_db-0.3.1/cloud_dog_db/config/models.py +212 -0
- cloud_dog_db-0.3.1/cloud_dog_db/crud/__init__.py +0 -0
- cloud_dog_db-0.3.1/cloud_dog_db/crud/repository.py +174 -0
- cloud_dog_db-0.3.1/cloud_dog_db/crud/specs.py +57 -0
- cloud_dog_db-0.3.1/cloud_dog_db/engine/__init__.py +0 -0
- cloud_dog_db-0.3.1/cloud_dog_db/engine/factory.py +104 -0
- cloud_dog_db-0.3.1/cloud_dog_db/health/__init__.py +0 -0
- cloud_dog_db-0.3.1/cloud_dog_db/health/probes.py +30 -0
- cloud_dog_db-0.3.1/cloud_dog_db/migrations/__init__.py +0 -0
- cloud_dog_db-0.3.1/cloud_dog_db/migrations/runner.py +114 -0
- cloud_dog_db-0.3.1/cloud_dog_db/migrations/templates/README.md +6 -0
- cloud_dog_db-0.3.1/cloud_dog_db/migrations/templates/env.py +50 -0
- cloud_dog_db-0.3.1/cloud_dog_db/migrations/templates/script.py.mako +24 -0
- cloud_dog_db-0.3.1/cloud_dog_db/models/__init__.py +13 -0
- cloud_dog_db-0.3.1/cloud_dog_db/models/base.py +33 -0
- cloud_dog_db-0.3.1/cloud_dog_db/models/mixins.py +67 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/__init__.py +110 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/_filters.py +86 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/aggregate.py +53 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/connectors/__init__.py +91 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/connectors/cassandra.py +771 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/connectors/couchbase.py +375 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/connectors/couchdb.py +853 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/connectors/elasticsearch.py +843 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/connectors/mongodb.py +489 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/connectors/opensearch.py +615 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/connectors/protocol.py +128 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/document.py +231 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/protocols.py +73 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/search.py +208 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/settings.py +129 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/timeseries.py +173 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/vector.py +112 -0
- cloud_dog_db-0.3.1/cloud_dog_db/nosql/widecolumn.py +136 -0
- cloud_dog_db-0.3.1/cloud_dog_db/session/__init__.py +0 -0
- cloud_dog_db-0.3.1/cloud_dog_db/session/session_manager.py +58 -0
- cloud_dog_db-0.3.1/cloud_dog_db/sql.py +85 -0
- cloud_dog_db-0.3.1/pyproject.toml +73 -0
- cloud_dog_db-0.3.1/tests/application/test_at_end_to_end_consumer_flow.py +68 -0
- cloud_dog_db-0.3.1/tests/assets/alembic/env.py +61 -0
- cloud_dog_db-0.3.1/tests/assets/alembic/script.py.mako +23 -0
- cloud_dog_db-0.3.1/tests/assets/alembic/versions/0001_create_widgets.py +39 -0
- cloud_dog_db-0.3.1/tests/conftest.py +257 -0
- cloud_dog_db-0.3.1/tests/env-AT +3 -0
- cloud_dog_db-0.3.1/tests/env-IT-mariadb +7 -0
- cloud_dog_db-0.3.1/tests/env-IT-postgres +7 -0
- cloud_dog_db-0.3.1/tests/env-IT-sqlite +3 -0
- cloud_dog_db-0.3.1/tests/env-ST +3 -0
- cloud_dog_db-0.3.1/tests/env-UT +3 -0
- cloud_dog_db-0.3.1/tests/integration/test_it_mariadb.py +76 -0
- cloud_dog_db-0.3.1/tests/integration/test_it_postgres.py +78 -0
- cloud_dog_db-0.3.1/tests/integration/test_it_sqlite.py +65 -0
- cloud_dog_db-0.3.1/tests/system/test_nosql_st.py +200 -0
- cloud_dog_db-0.3.1/tests/system/test_st_sqlite_lifecycle.py +70 -0
- cloud_dog_db-0.3.1/tests/unit/UT1.5_PlatformBase/test_platform_base.py +109 -0
- cloud_dog_db-0.3.1/tests/unit/UT1.6_SqlitePragma/test_sqlite_pragma.py +33 -0
- cloud_dog_db-0.3.1/tests/unit/test_nosql_unit.py +137 -0
- cloud_dog_db-0.3.1/tests/unit/test_ut_config_and_dsn.py +51 -0
- cloud_dog_db-0.3.1/tests/unit/test_ut_migration_runner.py +46 -0
- cloud_dog_db-0.3.1/tests/unit/test_ut_repository.py +70 -0
- cloud_dog_db-0.3.1/tests/unit/test_ut_session_managers.py +40 -0
- cloud_dog_db-0.3.1/working/W28A-130-PLATFORM-DB-TEST-REPAIR-REPORT.md +77 -0
- cloud_dog_db-0.3.1/working/at-platform-db.sqlite3 +0 -0
- cloud_dog_db-0.3.1/working/it-platform-db.sqlite3 +0 -0
- cloud_dog_db-0.3.1/working/st-platform-db.sqlite3 +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tmp/
|
|
Binary file
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# platform-db Architecture
|
|
2
|
+
|
|
3
|
+
## Modules
|
|
4
|
+
|
|
5
|
+
- `cloud_dog_db.config.models`
|
|
6
|
+
- Typed DB settings model and environment binding.
|
|
7
|
+
- `cloud_dog_db.engine.factory`
|
|
8
|
+
- Sync/async engine builders with dialect-aware defaults.
|
|
9
|
+
- `cloud_dog_db.session.session_manager`
|
|
10
|
+
- Session managers and transactional unit-of-work contexts.
|
|
11
|
+
- `cloud_dog_db.migrations.runner`
|
|
12
|
+
- Alembic-backed migration orchestration and CLI.
|
|
13
|
+
- `cloud_dog_db.crud.specs`
|
|
14
|
+
- Query/filter/sort/pagination specs.
|
|
15
|
+
- `cloud_dog_db.crud.repository`
|
|
16
|
+
- Generic repository and DB error taxonomy.
|
|
17
|
+
- `cloud_dog_db.health.probes`
|
|
18
|
+
- Readiness/liveness probes and migration guards.
|
|
19
|
+
|
|
20
|
+
## Request Flow (Consumer)
|
|
21
|
+
|
|
22
|
+
1. Consumer builds `DatabaseSettings` from env/config.
|
|
23
|
+
2. Engine/session manager created per sync/async execution path.
|
|
24
|
+
3. Startup optionally executes migration bootstrap (`upgrade head`).
|
|
25
|
+
4. Repository and unit-of-work abstractions handle business persistence.
|
|
26
|
+
5. Probes validate `SELECT 1` and migration revision compliance.
|
|
27
|
+
|
|
28
|
+
## Migration Design
|
|
29
|
+
|
|
30
|
+
- Alembic `Config` object is built at runtime.
|
|
31
|
+
- `version_table` and optional `version_table_schema` are injectable.
|
|
32
|
+
- Script location can be package templates or project migration directory.
|
|
33
|
+
|
|
34
|
+
## NoSQL / Search / Wide-Column / Vector / Time-Series Surface (W28E-605)
|
|
35
|
+
|
|
36
|
+
- `cloud_dog_db.nosql.settings` — `NoSqlSettings` (mirrors `DatabaseSettings`); `from_provider(vault_provider)` / `from_env`.
|
|
37
|
+
- `cloud_dog_db.nosql.protocols` — `DocumentRepository`, `SearchRepository`, `WideColumnRepository`, `TimeSeriesRepository` Protocols (mirror SQL `Repository` contract: `create/get/update/delete/list -> PageResult`).
|
|
38
|
+
- `cloud_dog_db.nosql.document` — MongoDB + CouchDB document repositories + `build_document_client`.
|
|
39
|
+
- `cloud_dog_db.nosql.search` — Elasticsearch + OpenSearch search repositories (shared base) + `build_search_client`.
|
|
40
|
+
- `cloud_dog_db.nosql.widecolumn` — Cassandra wide-column repository + `build_wide_column_client`.
|
|
41
|
+
- `cloud_dog_db.nosql.vector` — `probe_pgvector`, `ensure_vector_extension`, `PgVectorStore` (psycopg-based).
|
|
42
|
+
- `cloud_dog_db.nosql.timeseries` — `TimeSeriesRepository` (Mongo `$dateTrunc`, OpenSearch `date_histogram`, Postgres `date_trunc`).
|
|
43
|
+
- `cloud_dog_db.nosql.aggregate` — dialect-agnostic `aggregate` / `aggregate_by_time_bucket`.
|
|
44
|
+
- `cloud_dog_db.nosql._filters` — `QuerySpec` → Mongo / Elasticsearch query translation.
|
|
45
|
+
|
|
46
|
+
Design rules: driver imports (`pymongo`/`couchdb`/`elasticsearch`/`opensearchpy`/`cassandra`/`psycopg`) are confined to `cloud_dog_db.nosql.*` and loaded lazily, so importing the package needs no driver and each backend is an optional extra. The shared SQL error taxonomy and query specs are reused (NF.NS.1).
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Build Instructions
|
|
2
|
+
|
|
3
|
+
## Package
|
|
4
|
+
`cloud-dog-db` - database engine, sessions, and migrations.
|
|
5
|
+
|
|
6
|
+
## Prerequisites
|
|
7
|
+
- Python 3.11+
|
|
8
|
+
- pip
|
|
9
|
+
|
|
10
|
+
## Development Setup
|
|
11
|
+
```bash
|
|
12
|
+
python3 -m venv .venv
|
|
13
|
+
source .venv/bin/activate
|
|
14
|
+
pip install --upgrade pip build twine
|
|
15
|
+
pip install -e ".[dev]"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
If your environment resolves dependencies from an additional package index:
|
|
19
|
+
```bash
|
|
20
|
+
PYPI_URL=https://packages.example.com/simple/
|
|
21
|
+
pip install -e ".[dev]" --extra-index-url "$PYPI_URL"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Local Use
|
|
25
|
+
Install the package in editable mode and import it from an interactive shell or another local project:
|
|
26
|
+
```bash
|
|
27
|
+
python -c "import cloud_dog_db; print('package import ok')"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Run Tests
|
|
31
|
+
```bash
|
|
32
|
+
python -m pytest tests/unit --env tests/env-UT -v
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Build Distribution
|
|
36
|
+
```bash
|
|
37
|
+
python -m build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Publish
|
|
41
|
+
```bash
|
|
42
|
+
twine upload --repository-url "$PYPI_URL" dist/*
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Dependencies
|
|
46
|
+
- `sqlalchemy`, `alembic`
|
|
47
|
+
- optional extras are declared in `pyproject.toml`
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
Tests and sample programs can read configuration from shell variables, a local env file, and package defaults where available.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
template-id: T-PKG-CHG
|
|
3
|
+
template-version: 1.0
|
|
4
|
+
applies-to: CHANGELOG.md
|
|
5
|
+
registry: package
|
|
6
|
+
required: must-have
|
|
7
|
+
when-applicable: ""
|
|
8
|
+
template-last-updated: 2026-06-12
|
|
9
|
+
template-owner: platform-standards
|
|
10
|
+
|
|
11
|
+
project: platform-db
|
|
12
|
+
public: true
|
|
13
|
+
doc-last-updated: 2026-06-12
|
|
14
|
+
doc-git-commit: no-git
|
|
15
|
+
doc-git-branch: main
|
|
16
|
+
doc-source-shas: []
|
|
17
|
+
doc-age-policy: 90d
|
|
18
|
+
doc-conformance-stamp: 2026-06-12T12:00:00Z
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# platform-db — CHANGELOG
|
|
22
|
+
|
|
23
|
+
> **Template version:** T-PKG-CHG v1.0 — Keep a Changelog + SemVer.
|
|
24
|
+
|
|
25
|
+
## [Unreleased]
|
|
26
|
+
|
|
27
|
+
## [<version>] — <date>
|
|
28
|
+
### Added
|
|
29
|
+
### Changed
|
|
30
|
+
### Fixed
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
template-id: T-PKG-DMT
|
|
3
|
+
template-version: 1.0
|
|
4
|
+
applies-to: DATA-MODEL.md
|
|
5
|
+
registry: package
|
|
6
|
+
required: must-have
|
|
7
|
+
when-applicable: ""
|
|
8
|
+
template-last-updated: 2026-06-12
|
|
9
|
+
template-owner: platform-standards
|
|
10
|
+
|
|
11
|
+
project: platform-db
|
|
12
|
+
public: true
|
|
13
|
+
doc-last-updated: 2026-06-12
|
|
14
|
+
doc-git-commit: no-git
|
|
15
|
+
doc-git-branch: main
|
|
16
|
+
doc-source-shas: []
|
|
17
|
+
doc-age-policy: indefinite
|
|
18
|
+
doc-conformance-stamp: 2026-06-12T12:00:00Z
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# platform-db — DATA-MODEL
|
|
22
|
+
|
|
23
|
+
> **Template version:** T-PKG-DMT v1.0
|
|
24
|
+
|
|
25
|
+
## 1. Exported types
|
|
26
|
+
| Type | Shape | Purpose |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
|
|
29
|
+
## 2. Persisted state
|
|
30
|
+
If the package owns persisted state, describe schema.
|
|
31
|
+
|
|
32
|
+
## 3. Cross-references
|
|
33
|
+
- [ARCHITECTURE.md](ARCHITECTURE.md)
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 Cloud-Dog, Viewdeck Engineering Limited
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Copyright (c) 2026 Cloud-Dog, Viewdeck Engineering Limited
|
|
2
|
+
|
|
3
|
+
Apache License
|
|
4
|
+
Version 2.0, January 2004
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
|
|
136
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
137
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
138
|
+
except as required for reasonable and customary use in describing the
|
|
139
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
140
|
+
|
|
141
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
142
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
143
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
144
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
145
|
+
implied, including, without limitation, any warranties or conditions
|
|
146
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
147
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
148
|
+
appropriateness of using or redistributing the Work and assume any
|
|
149
|
+
risks associated with Your exercise of permissions under this License.
|
|
150
|
+
|
|
151
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
152
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
153
|
+
unless required by applicable law (such as deliberate and grossly
|
|
154
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
155
|
+
liable to You for damages, including any direct, indirect, special,
|
|
156
|
+
incidental, or consequential damages of any character arising as a
|
|
157
|
+
result of this License or out of the use or inability to use the
|
|
158
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
159
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
160
|
+
other commercial damages or losses), even if such Contributor
|
|
161
|
+
has been advised of the possibility of such damages.
|
|
162
|
+
|
|
163
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
164
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
165
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
166
|
+
or other liability obligations and/or rights consistent with this
|
|
167
|
+
License. However, in accepting such obligations, You may act only
|
|
168
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
169
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
170
|
+
defend, and hold each Contributor harmless for any liability
|
|
171
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
172
|
+
of your accepting any such warranty or additional liability.
|
|
173
|
+
|
|
174
|
+
END OF TERMS AND CONDITIONS
|
|
175
|
+
|
|
176
|
+
Copyright (C) Cloud-Dog, Viewdeck Engineering Ltd.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cloud_dog_db
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: PS-DB platform database foundation package for Cloud-Dog services (SQL + NoSQL/search/wide-column/vector/time-series + source connectors)
|
|
5
|
+
Project-URL: Source, https://github.com/cloud-dog-ai/platform-db
|
|
6
|
+
Author: Cloud-Dog, Viewdeck Engineering Limited
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
License-File: LICENCE
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
License-File: NOTICE
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Requires-Dist: alembic<2.0,>=1.13
|
|
13
|
+
Requires-Dist: pydantic<3.0,>=2.7
|
|
14
|
+
Requires-Dist: sqlalchemy<3.0,>=2.0
|
|
15
|
+
Provides-Extra: cassandra
|
|
16
|
+
Requires-Dist: cassandra-driver<4.0,>=3.28; extra == 'cassandra'
|
|
17
|
+
Provides-Extra: couchbase
|
|
18
|
+
Requires-Dist: couchbase<5.0,>=4.1; extra == 'couchbase'
|
|
19
|
+
Provides-Extra: couchdb
|
|
20
|
+
Requires-Dist: couchdb<2.0,>=1.2; extra == 'couchdb'
|
|
21
|
+
Requires-Dist: requests>=2.31; extra == 'couchdb'
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: aiosqlite>=0.20; extra == 'dev'
|
|
24
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
25
|
+
Requires-Dist: cassandra-driver<4.0,>=3.28; extra == 'dev'
|
|
26
|
+
Requires-Dist: couchdb<2.0,>=1.2; extra == 'dev'
|
|
27
|
+
Requires-Dist: elasticsearch<9.0,>=8.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: opensearch-py<4.0,>=2.4; extra == 'dev'
|
|
29
|
+
Requires-Dist: pgvector>=0.2; extra == 'dev'
|
|
30
|
+
Requires-Dist: psycopg[binary]>=3.2; extra == 'dev'
|
|
31
|
+
Requires-Dist: pymongo<5.0,>=4.6; extra == 'dev'
|
|
32
|
+
Requires-Dist: pymysql>=1.1; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
37
|
+
Provides-Extra: elasticsearch
|
|
38
|
+
Requires-Dist: elasticsearch<9.0,>=8.0; extra == 'elasticsearch'
|
|
39
|
+
Provides-Extra: mongodb
|
|
40
|
+
Requires-Dist: pymongo<5.0,>=4.6; extra == 'mongodb'
|
|
41
|
+
Provides-Extra: nosql
|
|
42
|
+
Requires-Dist: cassandra-driver<4.0,>=3.28; extra == 'nosql'
|
|
43
|
+
Requires-Dist: couchbase<5.0,>=4.1; extra == 'nosql'
|
|
44
|
+
Requires-Dist: couchdb<2.0,>=1.2; extra == 'nosql'
|
|
45
|
+
Requires-Dist: elasticsearch<9.0,>=8.0; extra == 'nosql'
|
|
46
|
+
Requires-Dist: opensearch-py<4.0,>=2.4; extra == 'nosql'
|
|
47
|
+
Requires-Dist: pgvector>=0.2; extra == 'nosql'
|
|
48
|
+
Requires-Dist: psycopg[binary]>=3.2; extra == 'nosql'
|
|
49
|
+
Requires-Dist: pymongo<5.0,>=4.6; extra == 'nosql'
|
|
50
|
+
Requires-Dist: requests>=2.31; extra == 'nosql'
|
|
51
|
+
Provides-Extra: opensearch
|
|
52
|
+
Requires-Dist: opensearch-py<4.0,>=2.4; extra == 'opensearch'
|
|
53
|
+
Provides-Extra: pgvector
|
|
54
|
+
Requires-Dist: pgvector>=0.2; extra == 'pgvector'
|
|
55
|
+
Requires-Dist: psycopg[binary]>=3.2; extra == 'pgvector'
|
|
56
|
+
Provides-Extra: sql
|
|
57
|
+
Requires-Dist: psycopg[binary]>=3.2; extra == 'sql'
|
|
58
|
+
Requires-Dist: pymysql>=1.1; extra == 'sql'
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# platform-db
|
|
2
|
+
|
|
3
|
+
**Package:** `cloud_dog_db`
|
|
4
|
+
**Standard track:** Platform DB package foundation (W15A)
|
|
5
|
+
|
|
6
|
+
`cloud_dog_db` provides reusable SQL database foundations for Cloud-Dog services with support for SQLite, MariaDB/MySQL, and PostgreSQL.
|
|
7
|
+
|
|
8
|
+
## Capabilities
|
|
9
|
+
|
|
10
|
+
- Dialect-aware sync/async SQLAlchemy engine/session factories
|
|
11
|
+
- Alembic migration runner API + CLI (`init`, `current`, `upgrade`, `downgrade`, `stamp`)
|
|
12
|
+
- Schema bootstrap helper (baseline -> head)
|
|
13
|
+
- Generic CRUD repository with filter/sort/pagination/bulk helpers
|
|
14
|
+
- Transactional unit-of-work helper
|
|
15
|
+
- DB health/readiness probes including migration revision checks
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from cloud_dog_db.config.models import DatabaseSettings
|
|
21
|
+
from cloud_dog_db.engine.factory import build_sync_engine
|
|
22
|
+
from cloud_dog_db.session.session_manager import SyncSessionManager
|
|
23
|
+
|
|
24
|
+
settings = DatabaseSettings.from_env(prefix="CLOUD_DOG_DB__")
|
|
25
|
+
engine = build_sync_engine(settings)
|
|
26
|
+
manager = SyncSessionManager(engine)
|
|
27
|
+
|
|
28
|
+
with manager.session() as session:
|
|
29
|
+
session.execute("SELECT 1")
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## CLI
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cloud-dog-db-migrate --script-location ./database/migrations --url sqlite:///./app.db upgrade head
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Documents
|
|
39
|
+
|
|
40
|
+
- `REQUIREMENTS.md`
|
|
41
|
+
- `ARCHITECTURE.md`
|
|
42
|
+
- `TESTS.md`
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Licence
|
|
47
|
+
|
|
48
|
+
Apache-2.0 — Copyright (c) 2026 Cloud-Dog, Viewdeck Engineering Limited
|