cinchdb 0.1.10__py3-none-any.whl → 0.1.12__py3-none-any.whl
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.
- cinchdb/cli/commands/column.py +3 -4
- cinchdb/cli/commands/database.py +58 -60
- cinchdb/cli/commands/table.py +3 -3
- cinchdb/cli/main.py +1 -7
- cinchdb/cli/utils.py +23 -0
- cinchdb/core/database.py +138 -11
- cinchdb/core/initializer.py +188 -10
- cinchdb/core/path_utils.py +44 -27
- cinchdb/infrastructure/metadata_connection_pool.py +145 -0
- cinchdb/infrastructure/metadata_db.py +376 -0
- cinchdb/managers/branch.py +119 -23
- cinchdb/managers/change_applier.py +30 -13
- cinchdb/managers/column.py +4 -10
- cinchdb/managers/query.py +40 -4
- cinchdb/managers/table.py +8 -6
- cinchdb/managers/tenant.py +698 -167
- cinchdb/models/table.py +0 -4
- cinchdb/models/tenant.py +4 -2
- {cinchdb-0.1.10.dist-info → cinchdb-0.1.12.dist-info}/METADATA +10 -37
- {cinchdb-0.1.10.dist-info → cinchdb-0.1.12.dist-info}/RECORD +23 -21
- {cinchdb-0.1.10.dist-info → cinchdb-0.1.12.dist-info}/WHEEL +0 -0
- {cinchdb-0.1.10.dist-info → cinchdb-0.1.12.dist-info}/entry_points.txt +0 -0
- {cinchdb-0.1.10.dist-info → cinchdb-0.1.12.dist-info}/licenses/LICENSE +0 -0
cinchdb/models/table.py
CHANGED
@@ -50,9 +50,6 @@ class Column(BaseModel):
|
|
50
50
|
default: Optional[str] = Field(
|
51
51
|
default=None, description="Default value SQL expression"
|
52
52
|
)
|
53
|
-
primary_key: bool = Field(
|
54
|
-
default=False, description="Whether this is a primary key"
|
55
|
-
)
|
56
53
|
unique: bool = Field(default=False, description="Whether values must be unique")
|
57
54
|
foreign_key: Optional[ForeignKeyRef] = Field(
|
58
55
|
default=None, description="Foreign key constraint specification"
|
@@ -81,7 +78,6 @@ class Table(CinchDBBaseModel):
|
|
81
78
|
name="id",
|
82
79
|
type="TEXT",
|
83
80
|
nullable=False,
|
84
|
-
primary_key=True,
|
85
81
|
unique=True,
|
86
82
|
),
|
87
83
|
)
|
cinchdb/models/tenant.py
CHANGED
@@ -19,9 +19,11 @@ class Tenant(CinchDBBaseModel):
|
|
19
19
|
@classmethod
|
20
20
|
def validate_name_field(cls, v: str) -> str:
|
21
21
|
"""Validate tenant name meets naming requirements."""
|
22
|
-
|
22
|
+
# Allow __empty__ as a special system tenant
|
23
|
+
if v != "__empty__":
|
24
|
+
validate_name(v, "tenant")
|
23
25
|
return v
|
24
26
|
|
25
27
|
def can_delete(self) -> bool:
|
26
28
|
"""Check if this tenant can be deleted."""
|
27
|
-
return self.name
|
29
|
+
return self.name not in ["main", "__empty__"] and not self.is_main
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: cinchdb
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.12
|
4
4
|
Summary: A Git-like SQLite database management system with branching and multi-tenancy
|
5
5
|
Project-URL: Homepage, https://github.com/russellromney/cinchdb
|
6
6
|
Project-URL: Documentation, https://russellromney.github.io/cinchdb
|
@@ -39,7 +39,11 @@ Because it's so lightweight and its only dependencies are pydantic, requests, an
|
|
39
39
|
|
40
40
|
|
41
41
|
```bash
|
42
|
-
uv
|
42
|
+
# Recommended: Install with uv (faster, better dependency resolution)
|
43
|
+
uv add cinchdb
|
44
|
+
|
45
|
+
# Or with pip
|
46
|
+
pip install cinchdb
|
43
47
|
|
44
48
|
# Initialize project
|
45
49
|
cinch init
|
@@ -58,10 +62,7 @@ cinch branch merge-into-main feature
|
|
58
62
|
cinch tenant create customer_a
|
59
63
|
cinch query "SELECT * FROM users" --tenant customer_a
|
60
64
|
|
61
|
-
#
|
62
|
-
# Connect to remote CinchDB instance
|
63
|
-
cinch remote add production https://your-cinchdb-server.com your-api-key
|
64
|
-
cinch remote use production
|
65
|
+
# Future: Remote connectivity planned for production deployment
|
65
66
|
|
66
67
|
# Autogenerate Python SDK from database
|
67
68
|
cinch codegen generate python cinchdb_models/
|
@@ -75,9 +76,7 @@ CinchDB combines SQLite with Git-like workflows for database schema management:
|
|
75
76
|
- **Multi-tenant isolation** - shared schema, isolated data per tenant
|
76
77
|
- **Automatic change tracking** - all schema changes tracked and mergeable
|
77
78
|
- **Safe structure changes** - change merges happen atomically with zero rollback risk (seriously)
|
78
|
-
- **
|
79
|
-
- **Type-safe SDK** - Python and TypeScript SDKs with full type safety
|
80
|
-
- **Remote-capable** - coming soon - CLI and SDK can connect to remote instances
|
79
|
+
- **Type-safe Python SDK** - Python SDK with full type safety
|
81
80
|
- **SDK generation from database schema** - Generate a typesafe SDK from your database models for CRUD operations
|
82
81
|
|
83
82
|
## Installation
|
@@ -149,37 +148,11 @@ results = db.insert("posts", *post_list)
|
|
149
148
|
db.update("posts", post_id, {"content": "Updated content"})
|
150
149
|
```
|
151
150
|
|
152
|
-
### Remote Connection
|
153
|
-
|
154
|
-
Coming soon.
|
155
|
-
|
156
|
-
```python
|
157
|
-
# Connect to remote instance
|
158
|
-
db = cinchdb.connect("myapp", url="https://your-cinchdb-server.com", api_key="your-api-key")
|
159
|
-
|
160
|
-
# Same interface as local
|
161
|
-
results = db.query("SELECT * FROM users")
|
162
|
-
user_id = db.insert("users", {"username": "alice", "email": "alice@example.com"})
|
163
|
-
```
|
164
|
-
|
165
|
-
## Remote Access - coming soon
|
166
|
-
|
167
|
-
Connect to a remote CinchDB instance:
|
168
|
-
|
169
|
-
```bash
|
170
|
-
cinch remote add production https://your-cinchdb-server.com your-api-key
|
171
|
-
cinch remote use production
|
172
|
-
# Now all commands will use the remote instance
|
173
|
-
```
|
174
|
-
|
175
|
-
Interactive docs at `/docs`, health check at `/health`.
|
176
151
|
|
177
152
|
## Architecture
|
178
153
|
|
179
|
-
- **Python SDK**: Core functionality
|
180
|
-
- **CLI**: Full-featured command-line interface
|
181
|
-
- **Remote Access**: Connect to hosted CinchDB instances
|
182
|
-
- **TypeScript SDK**: Browser and Node.js client
|
154
|
+
- **Python SDK**: Core functionality for local development
|
155
|
+
- **CLI**: Full-featured command-line interface
|
183
156
|
|
184
157
|
## Development
|
185
158
|
|
@@ -2,40 +2,42 @@ cinchdb/__init__.py,sha256=NZdSzfhRguSBTjJ2dcESOQYy53OZEuBndlB7U08GMY0,179
|
|
2
2
|
cinchdb/__main__.py,sha256=OpkDqn9zkTZhhYgvv_grswWLAHKbmxs4M-8C6Z5HfWY,85
|
3
3
|
cinchdb/config.py,sha256=gocjMnYKLWhgvnteo6zprgwtK6Oevoxq547J_v-C9Ns,5265
|
4
4
|
cinchdb/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
cinchdb/cli/main.py,sha256=
|
6
|
-
cinchdb/cli/utils.py,sha256=
|
5
|
+
cinchdb/cli/main.py,sha256=iAh19hD4uiWmQmvGS6gZD7WodLxoYUXK8lsZsf7BJdA,4461
|
6
|
+
cinchdb/cli/utils.py,sha256=InAGuo7uENvsfBQu6EKIbbiNXqmvg-BecLmhLvOz5qg,6485
|
7
7
|
cinchdb/cli/commands/__init__.py,sha256=IRUIPHgdpF4hBDbDy0SgaWn39o5GNUjH54_C42sjlQg,273
|
8
8
|
cinchdb/cli/commands/branch.py,sha256=Nz8YQYJ7lizSXEAv0usTx85TDOC-N5Ul9KIxN8JQtKc,17973
|
9
9
|
cinchdb/cli/commands/codegen.py,sha256=WsRWmXNTDuaLPyECW5psXM9zOQnKHpUiv8BJnBAjMII,6189
|
10
|
-
cinchdb/cli/commands/column.py,sha256=
|
11
|
-
cinchdb/cli/commands/database.py,sha256
|
10
|
+
cinchdb/cli/commands/column.py,sha256=nUVgjYbxSobJR9CC-qdOvrCl1TgFySr-ctQb0djKZtQ,11676
|
11
|
+
cinchdb/cli/commands/database.py,sha256=A3ew8Z987a25dRxmY5XeoB-Ka6SXLKtWogj3XAKUNZE,7332
|
12
12
|
cinchdb/cli/commands/index.py,sha256=P0sM9lu1rVliacYl49LPqtxNYdrwzKzpVKW10jC-5i4,6096
|
13
13
|
cinchdb/cli/commands/query.py,sha256=XW_YL6M5IYHHHMpVB5p-M01kawFxwDOK5B5hGIy_BA8,5044
|
14
14
|
cinchdb/cli/commands/remote.py,sha256=i07hfiAxgrROB9lVJVaKK_nWxT1SGiSbtFb4jvEwxEo,4445
|
15
|
-
cinchdb/cli/commands/table.py,sha256=
|
15
|
+
cinchdb/cli/commands/table.py,sha256=K233WOV102-g6QlHhL97FhfiGz67zIctbxZblAjY4Lg,10516
|
16
16
|
cinchdb/cli/commands/tenant.py,sha256=cOWs9Gf13ZE4KTKJZ_AvDwFDdXBUn5i-Av4MoUsc8Go,6199
|
17
17
|
cinchdb/cli/commands/view.py,sha256=ZmS1IW7idzzHAXmgVyY3C4IQRo7toHb6fHNFY_tQJjI,6385
|
18
18
|
cinchdb/cli/handlers/__init__.py,sha256=f2f-Cc96rSBLbVsiIbf-b4pZCKZoHfmhNEvnZ0OurRs,131
|
19
19
|
cinchdb/cli/handlers/codegen_handler.py,sha256=i5we_AbiUW3zfO6pIKWxvtO8OvOqz3H__4xPmTLEuQM,6524
|
20
20
|
cinchdb/core/__init__.py,sha256=iNlT0iO9cM0HLoYwzBavUBoXRh1Tcnz1l_vfbwVxK_Q,246
|
21
21
|
cinchdb/core/connection.py,sha256=SlKyEfIpeaDws8M6SfEbvCEVnt26zBY1RYwHtTXj0kY,5110
|
22
|
-
cinchdb/core/database.py,sha256=
|
23
|
-
cinchdb/core/initializer.py,sha256=
|
22
|
+
cinchdb/core/database.py,sha256=vzVr6Y6iydf9kOU0OO7yVYoHQJ3zlfwAWF2LylJUV0I,27162
|
23
|
+
cinchdb/core/initializer.py,sha256=CAzq947plgEF-KXV-PD-ycJ8Zy4zXCQqCrmQ0-pV0i4,14474
|
24
24
|
cinchdb/core/maintenance.py,sha256=PAgrSL7Cj9p3rKHV0h_L7gupN6nLD0-5eQpJZNiqyEs,2097
|
25
|
-
cinchdb/core/path_utils.py,sha256=
|
25
|
+
cinchdb/core/path_utils.py,sha256=OPT5WGx6CPdjZbvNsB5fjJGKsl5RtW8-IFacE4TWSxA,4884
|
26
|
+
cinchdb/infrastructure/metadata_connection_pool.py,sha256=oq4z2B43_kEPUA0QVZz6AI_xl4adOuOSJ7VeZ7ecmP4,4899
|
27
|
+
cinchdb/infrastructure/metadata_db.py,sha256=QLVHtvto9c2yJw7022JXwfaEilS-k-OICsbHQvA6QSQ,15314
|
26
28
|
cinchdb/managers/__init__.py,sha256=ic61ZUdsg-muq0ETYO6fuZRQWF4j7l920PthTkt2QrE,808
|
27
|
-
cinchdb/managers/branch.py,sha256=
|
28
|
-
cinchdb/managers/change_applier.py,sha256=
|
29
|
+
cinchdb/managers/branch.py,sha256=ctX2RpodtQ-fLMpGzHyJMydseb0rK4gLjMz2ix82seU,9455
|
30
|
+
cinchdb/managers/change_applier.py,sha256=cCgjUL6SJvrgVCCHAw0mAbGqZqKmMsLa0QbziSiuW68,15576
|
29
31
|
cinchdb/managers/change_comparator.py,sha256=08pwybpSt36cFwhZRSIkHynvFMUaLKEVwa8Ajn_R9yQ,6862
|
30
32
|
cinchdb/managers/change_tracker.py,sha256=U93BPnuGv8xSaO5qr_y5Q8ppKrVXygozdp5zUvLUqwg,5054
|
31
33
|
cinchdb/managers/codegen.py,sha256=1CfIwjgHnNDdjrq4SzQ9VE7DFgnWfk7RtpupBFUTqxk,21804
|
32
|
-
cinchdb/managers/column.py,sha256=
|
34
|
+
cinchdb/managers/column.py,sha256=i0EzDKavMvZeeaVrY9OVRNHOW60v0rUEkDjMtIs3PaE,20749
|
33
35
|
cinchdb/managers/data.py,sha256=zS1HkMGf436m6f8VdFAqQbQFgo4sL5yKJRcRf4A6lIc,16253
|
34
36
|
cinchdb/managers/index.py,sha256=n9bCXggZP6muJQZXCpTT46JvuvcbbnYgeV3j6iXtTVM,10371
|
35
37
|
cinchdb/managers/merge_manager.py,sha256=R8S2hLkLJg4hLDpeJTzjVkduZgqPOjXtYgOSJhTXXrE,15690
|
36
|
-
cinchdb/managers/query.py,sha256=
|
37
|
-
cinchdb/managers/table.py,sha256=
|
38
|
-
cinchdb/managers/tenant.py,sha256=
|
38
|
+
cinchdb/managers/query.py,sha256=mBWsWjdAqWDzuvxKsY49onAOP6dsZOMhVKwA7Y1kunE,8617
|
39
|
+
cinchdb/managers/table.py,sha256=8w6L4-DJgvsvpTYDW123Y9JuXO95O-SfOs-XMqWSvzA,14028
|
40
|
+
cinchdb/managers/tenant.py,sha256=szmgErdqs3KXPi5LugMnUR76PxWARMj6H6y-JvcYd68,33965
|
39
41
|
cinchdb/managers/view.py,sha256=v9gYtRufZyxywPKLGvIjvlUXcxYh9CLRArefu9QX6zk,7809
|
40
42
|
cinchdb/models/__init__.py,sha256=cZ-ailJ6qu44Iap5Rq555iB-_w9ufXVDBH3rDH-ojk0,622
|
41
43
|
cinchdb/models/base.py,sha256=7j4rlFTP5K9ZuF8vxwC7lMFEaL7O90NJ47Ig5i7ubcw,1320
|
@@ -43,14 +45,14 @@ cinchdb/models/branch.py,sha256=gRgLpRFkMC3fxf9ZigVOkS6wdkBERWqlLk0_gOYjqNk,1180
|
|
43
45
|
cinchdb/models/change.py,sha256=YpBWdI6yMT3uucd8duET9s75xr5JUWJqurkkyTlXPlk,1449
|
44
46
|
cinchdb/models/database.py,sha256=QrWd_SkE1G8TMWflO4sXRUbSdbqcrfGOt2e-PS7OW7A,971
|
45
47
|
cinchdb/models/project.py,sha256=6GMXUZUsEIebqQJgRXIthWzpWKuNNmJ3drgI1vFDrMo,644
|
46
|
-
cinchdb/models/table.py,sha256=
|
47
|
-
cinchdb/models/tenant.py,sha256=
|
48
|
+
cinchdb/models/table.py,sha256=nxf__C_YvDOW-6-vdOQ4xKmwWPZwgEdYw1I4mO_C44o,2955
|
49
|
+
cinchdb/models/tenant.py,sha256=wTvGoO_tQdtueVB0faZFVIhSjh_DNJzywflrUpngWTM,1072
|
48
50
|
cinchdb/models/view.py,sha256=q6j-jYzFJuhRJO87rKt6Uv8hOizHQx8xwoPKoH6XnNY,530
|
49
51
|
cinchdb/utils/__init__.py,sha256=yQQhEjndDiB2SUJybUmp9dvEOQKiR-GySe-WiCius5E,490
|
50
52
|
cinchdb/utils/name_validator.py,sha256=dyGX5bjlTFRA9EGrWRQKp6kR__HSV04hLV5VueJs4IQ,4027
|
51
53
|
cinchdb/utils/sql_validator.py,sha256=aWOGlPX0gBkuR6R1EBP2stbP4PHZuI6FUBi2Ljx7JUI,5815
|
52
|
-
cinchdb-0.1.
|
53
|
-
cinchdb-0.1.
|
54
|
-
cinchdb-0.1.
|
55
|
-
cinchdb-0.1.
|
56
|
-
cinchdb-0.1.
|
54
|
+
cinchdb-0.1.12.dist-info/METADATA,sha256=iXOb9UnRYHZJ4gG4j9c_Z8Oxk-hvVdsgXWdFNk49IBo,5471
|
55
|
+
cinchdb-0.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
56
|
+
cinchdb-0.1.12.dist-info/entry_points.txt,sha256=VBOIzvnGbkKudMCCmNORS3885QSyjZUVKJQ-Syqa62w,47
|
57
|
+
cinchdb-0.1.12.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
58
|
+
cinchdb-0.1.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|