cinchdb 0.1.0__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/__init__.py +7 -0
- cinchdb/__main__.py +6 -0
- cinchdb/api/__init__.py +5 -0
- cinchdb/api/app.py +76 -0
- cinchdb/api/auth.py +290 -0
- cinchdb/api/main.py +137 -0
- cinchdb/api/routers/__init__.py +25 -0
- cinchdb/api/routers/auth.py +135 -0
- cinchdb/api/routers/branches.py +368 -0
- cinchdb/api/routers/codegen.py +164 -0
- cinchdb/api/routers/columns.py +290 -0
- cinchdb/api/routers/data.py +479 -0
- cinchdb/api/routers/databases.py +177 -0
- cinchdb/api/routers/projects.py +133 -0
- cinchdb/api/routers/query.py +156 -0
- cinchdb/api/routers/tables.py +349 -0
- cinchdb/api/routers/tenants.py +216 -0
- cinchdb/api/routers/views.py +219 -0
- cinchdb/cli/__init__.py +0 -0
- cinchdb/cli/commands/__init__.py +1 -0
- cinchdb/cli/commands/branch.py +479 -0
- cinchdb/cli/commands/codegen.py +176 -0
- cinchdb/cli/commands/column.py +308 -0
- cinchdb/cli/commands/database.py +212 -0
- cinchdb/cli/commands/query.py +136 -0
- cinchdb/cli/commands/remote.py +144 -0
- cinchdb/cli/commands/table.py +289 -0
- cinchdb/cli/commands/tenant.py +173 -0
- cinchdb/cli/commands/view.py +189 -0
- cinchdb/cli/handlers/__init__.py +5 -0
- cinchdb/cli/handlers/codegen_handler.py +189 -0
- cinchdb/cli/main.py +137 -0
- cinchdb/cli/utils.py +182 -0
- cinchdb/config.py +177 -0
- cinchdb/core/__init__.py +5 -0
- cinchdb/core/connection.py +175 -0
- cinchdb/core/database.py +537 -0
- cinchdb/core/maintenance.py +73 -0
- cinchdb/core/path_utils.py +153 -0
- cinchdb/managers/__init__.py +26 -0
- cinchdb/managers/branch.py +167 -0
- cinchdb/managers/change_applier.py +414 -0
- cinchdb/managers/change_comparator.py +194 -0
- cinchdb/managers/change_tracker.py +182 -0
- cinchdb/managers/codegen.py +523 -0
- cinchdb/managers/column.py +579 -0
- cinchdb/managers/data.py +455 -0
- cinchdb/managers/merge_manager.py +429 -0
- cinchdb/managers/query.py +214 -0
- cinchdb/managers/table.py +383 -0
- cinchdb/managers/tenant.py +258 -0
- cinchdb/managers/view.py +252 -0
- cinchdb/models/__init__.py +27 -0
- cinchdb/models/base.py +44 -0
- cinchdb/models/branch.py +26 -0
- cinchdb/models/change.py +47 -0
- cinchdb/models/database.py +20 -0
- cinchdb/models/project.py +20 -0
- cinchdb/models/table.py +86 -0
- cinchdb/models/tenant.py +19 -0
- cinchdb/models/view.py +15 -0
- cinchdb/utils/__init__.py +15 -0
- cinchdb/utils/sql_validator.py +137 -0
- cinchdb-0.1.0.dist-info/METADATA +195 -0
- cinchdb-0.1.0.dist-info/RECORD +68 -0
- cinchdb-0.1.0.dist-info/WHEEL +4 -0
- cinchdb-0.1.0.dist-info/entry_points.txt +3 -0
- cinchdb-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,137 @@
|
|
1
|
+
"""SQL Query Validator for CinchDB.
|
2
|
+
|
3
|
+
Validates SQL queries to ensure only safe DML operations are allowed,
|
4
|
+
preventing structural database changes.
|
5
|
+
"""
|
6
|
+
|
7
|
+
import re
|
8
|
+
from typing import Tuple, Optional
|
9
|
+
from enum import Enum
|
10
|
+
|
11
|
+
|
12
|
+
class SQLOperation(Enum):
|
13
|
+
"""Allowed SQL operations."""
|
14
|
+
SELECT = "SELECT"
|
15
|
+
INSERT = "INSERT"
|
16
|
+
UPDATE = "UPDATE"
|
17
|
+
DELETE = "DELETE"
|
18
|
+
|
19
|
+
|
20
|
+
# List of restricted DDL operations and keywords
|
21
|
+
RESTRICTED_OPERATIONS = {
|
22
|
+
'CREATE', 'ALTER', 'DROP', 'TRUNCATE', 'RENAME',
|
23
|
+
'GRANT', 'REVOKE', 'ANALYZE', 'VACUUM', 'ATTACH',
|
24
|
+
'DETACH', 'PRAGMA', 'REINDEX', 'SAVEPOINT', 'RELEASE'
|
25
|
+
}
|
26
|
+
|
27
|
+
# Additional restricted keywords that could modify schema
|
28
|
+
RESTRICTED_KEYWORDS = {
|
29
|
+
'ADD COLUMN', 'DROP COLUMN', 'MODIFY COLUMN',
|
30
|
+
'ADD CONSTRAINT', 'DROP CONSTRAINT', 'ADD INDEX',
|
31
|
+
'DROP INDEX', 'CREATE INDEX', 'CREATE UNIQUE',
|
32
|
+
'CREATE VIEW', 'DROP VIEW', 'CREATE TRIGGER',
|
33
|
+
'DROP TRIGGER', 'CREATE PROCEDURE', 'DROP PROCEDURE',
|
34
|
+
'CREATE FUNCTION', 'DROP FUNCTION'
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
class SQLValidationError(Exception):
|
39
|
+
"""Raised when SQL query validation fails."""
|
40
|
+
pass
|
41
|
+
|
42
|
+
|
43
|
+
def validate_sql_query(query: str, allow_multiple_statements: bool = False) -> Tuple[bool, Optional[str], Optional[SQLOperation]]:
|
44
|
+
"""Validate a SQL query to ensure it only contains allowed operations.
|
45
|
+
|
46
|
+
Allowed operations: SELECT, INSERT, UPDATE, DELETE
|
47
|
+
Blocked operations: All DDL operations (CREATE, ALTER, DROP, etc.)
|
48
|
+
|
49
|
+
Args:
|
50
|
+
query: The SQL query to validate
|
51
|
+
allow_multiple_statements: Whether to allow multiple SQL statements (default: False)
|
52
|
+
|
53
|
+
Returns:
|
54
|
+
Tuple of (is_valid, error_message, operation)
|
55
|
+
- is_valid: True if query is valid
|
56
|
+
- error_message: Error description if invalid, None if valid
|
57
|
+
- operation: The SQL operation type if valid, None if invalid
|
58
|
+
"""
|
59
|
+
if not query or not query.strip():
|
60
|
+
return False, "Query cannot be empty", None
|
61
|
+
|
62
|
+
# Normalize the query - remove comments and extra whitespace
|
63
|
+
normalized_query = query
|
64
|
+
# Remove single-line comments
|
65
|
+
normalized_query = re.sub(r'--.*$', '', normalized_query, flags=re.MULTILINE)
|
66
|
+
# Remove multi-line comments
|
67
|
+
normalized_query = re.sub(r'/\*[\s\S]*?\*/', '', normalized_query)
|
68
|
+
# Replace multiple spaces with single space
|
69
|
+
normalized_query = re.sub(r'\s+', ' ', normalized_query)
|
70
|
+
normalized_query = normalized_query.strip().upper()
|
71
|
+
|
72
|
+
if not normalized_query:
|
73
|
+
return False, "Query cannot be empty after removing comments", None
|
74
|
+
|
75
|
+
# Check for multiple statements (security risk)
|
76
|
+
if not allow_multiple_statements:
|
77
|
+
# Count semicolons that are not at the end
|
78
|
+
semicolon_pos = normalized_query.find(';')
|
79
|
+
if semicolon_pos != -1 and semicolon_pos < len(normalized_query) - 1:
|
80
|
+
# Check if there's non-whitespace after the semicolon
|
81
|
+
remaining = normalized_query[semicolon_pos + 1:].strip()
|
82
|
+
if remaining:
|
83
|
+
return False, "Multiple statements are not allowed. Please execute one query at a time.", None
|
84
|
+
|
85
|
+
# Extract the first word (operation)
|
86
|
+
first_word = normalized_query.split()[0].rstrip(';')
|
87
|
+
|
88
|
+
# Check if it's an allowed operation
|
89
|
+
try:
|
90
|
+
operation = SQLOperation(first_word)
|
91
|
+
|
92
|
+
# Additional validation for UPDATE and DELETE
|
93
|
+
if operation in (SQLOperation.UPDATE, SQLOperation.DELETE):
|
94
|
+
# Warning if no WHERE clause (we don't block it, just log)
|
95
|
+
if 'WHERE' not in normalized_query:
|
96
|
+
import logging
|
97
|
+
logging.warning(f"{operation.value} statement without WHERE clause detected")
|
98
|
+
|
99
|
+
return True, None, operation
|
100
|
+
except ValueError:
|
101
|
+
# Not a recognized allowed operation
|
102
|
+
pass
|
103
|
+
|
104
|
+
# Check for restricted operations
|
105
|
+
for restricted in RESTRICTED_OPERATIONS:
|
106
|
+
if normalized_query.startswith(restricted):
|
107
|
+
return False, f"{restricted} operations are not allowed. Only SELECT, INSERT, UPDATE, and DELETE queries are permitted.", None
|
108
|
+
|
109
|
+
# Check for restricted keywords anywhere in the query
|
110
|
+
for keyword in RESTRICTED_KEYWORDS:
|
111
|
+
if keyword in normalized_query:
|
112
|
+
return False, f"Query contains restricted operation: {keyword}. Only SELECT, INSERT, UPDATE, and DELETE queries are permitted.", None
|
113
|
+
|
114
|
+
# Check for WITH statements that might contain DDL
|
115
|
+
if normalized_query.startswith('WITH'):
|
116
|
+
# Check if the CTE contains any DDL operations
|
117
|
+
for restricted in RESTRICTED_OPERATIONS:
|
118
|
+
if restricted in normalized_query:
|
119
|
+
return False, f"CTE (WITH clause) containing {restricted} operations is not allowed.", None
|
120
|
+
|
121
|
+
# If we get here, it's an unrecognized operation
|
122
|
+
return False, "Unrecognized or restricted SQL operation. Only SELECT, INSERT, UPDATE, and DELETE queries are permitted.", None
|
123
|
+
|
124
|
+
|
125
|
+
def validate_query_safe(query: str, allow_multiple_statements: bool = False) -> None:
|
126
|
+
"""Validate a SQL query and raise an exception if invalid.
|
127
|
+
|
128
|
+
Args:
|
129
|
+
query: The SQL query to validate
|
130
|
+
allow_multiple_statements: Whether to allow multiple SQL statements
|
131
|
+
|
132
|
+
Raises:
|
133
|
+
SQLValidationError: If the query is invalid
|
134
|
+
"""
|
135
|
+
is_valid, error_message, _ = validate_sql_query(query, allow_multiple_statements)
|
136
|
+
if not is_valid:
|
137
|
+
raise SQLValidationError(error_message)
|
@@ -0,0 +1,195 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: cinchdb
|
3
|
+
Version: 0.1.0
|
4
|
+
Summary: A Git-like SQLite database management system with branching and multi-tenancy
|
5
|
+
Project-URL: Homepage, https://github.com/russellromney/cinchdb
|
6
|
+
Project-URL: Documentation, https://russellromney.github.io/cinchdb
|
7
|
+
Project-URL: Repository, https://github.com/russellromney/cinchdb
|
8
|
+
Project-URL: Issues, https://github.com/russellromney/cinchdb/issues
|
9
|
+
Author: Russell Romney
|
10
|
+
License: MIT
|
11
|
+
License-File: LICENSE
|
12
|
+
Keywords: branching,database,git,multi-tenant,sqlite
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
14
|
+
Classifier: Intended Audience :: Developers
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
20
|
+
Requires-Python: >=3.10
|
21
|
+
Requires-Dist: fastapi>=0.115.0
|
22
|
+
Requires-Dist: pydantic>=2.0.0
|
23
|
+
Requires-Dist: python-multipart>=0.0.12
|
24
|
+
Requires-Dist: requests>=2.28.0
|
25
|
+
Requires-Dist: rich>=13.0.0
|
26
|
+
Requires-Dist: toml>=0.10.0
|
27
|
+
Requires-Dist: typer>=0.9.0
|
28
|
+
Requires-Dist: uvicorn>=0.32.0
|
29
|
+
Description-Content-Type: text/markdown
|
30
|
+
|
31
|
+
# CinchDB
|
32
|
+
|
33
|
+
**Git-like SQLite database management with branching and multi-tenancy**
|
34
|
+
|
35
|
+
NOTE: CinchDB is in early alpha. This is project to test out an idea. Do not use this in production.
|
36
|
+
|
37
|
+
CinchDB is for projects that need to isolate data per-tenant [or even per-user](https://turso.tech/blog/give-each-of-your-users-their-own-sqlite-database-b74445f4) and/or want to test out changes to structure safely in branchces. Plus, queries can be super, super fast because data is separated per tenant so it's <data_size>/<n_tenants> instead of <data_size>
|
38
|
+
|
39
|
+
On a meta level, I made this because I wanted a database structure that I felt comfortable letting AI agents take full control over, safely, and I didn't want to run my own Postgres instance somewhere or pay for it on e.g. Neon - I don't need hyperscaling, I just need super fast queries.
|
40
|
+
|
41
|
+
Because it's so lightweight and its only dependencies are FastAPI, pydantic, requests, and Typer, it is super cheap to run on a small VM like from [Fly.io](https://fly.io) and I don't need to SSH into it to connect - I can just store an API key in my local projects.
|
42
|
+
|
43
|
+
|
44
|
+
```bash
|
45
|
+
uv pip install cinchdb
|
46
|
+
|
47
|
+
# Initialize project
|
48
|
+
cinch init
|
49
|
+
|
50
|
+
# Create and query tables
|
51
|
+
cinch table create users name:TEXT email:TEXT
|
52
|
+
cinch query "SELECT * FROM users"
|
53
|
+
|
54
|
+
# Git-like branching
|
55
|
+
cinch branch create feature
|
56
|
+
cinch branch switch feature
|
57
|
+
cinch table create products name:TEXT price:REAL
|
58
|
+
cinch branch merge-into-main feature
|
59
|
+
|
60
|
+
# Multi-tenant support
|
61
|
+
cinch tenant create customer_a
|
62
|
+
cinch query "SELECT * FROM users" --tenant customer_a
|
63
|
+
|
64
|
+
# API server
|
65
|
+
uv pip install cinchdb[server]
|
66
|
+
cinch-server serve
|
67
|
+
|
68
|
+
# Autogenerate Python SDK from database
|
69
|
+
cinch codegen generate python cinchdb_models/
|
70
|
+
```
|
71
|
+
|
72
|
+
## What is CinchDB?
|
73
|
+
|
74
|
+
CinchDB combines SQLite with Git-like workflows for database schema management:
|
75
|
+
|
76
|
+
- **Branch schemas** like code - create feature branches, make changes, merge back
|
77
|
+
- **Multi-tenant isolation** - shared schema, isolated data per tenant
|
78
|
+
- **Automatic change tracking** - all schema changes tracked and mergeable
|
79
|
+
- **Safe structure changes** - change merges happen atomically with zero rollback risk (seriously)
|
80
|
+
- **Remote deployment** - FastAPI server with UUID authentication
|
81
|
+
- **Type-safe SDK** - Python and TypeScript SDKs with full type safety
|
82
|
+
- **API server for remote hosting** - Useful for running many web projects
|
83
|
+
- **SDK generation from database schema** - Generate a typesafe SDK from your database models for CRUD operations
|
84
|
+
|
85
|
+
## Installation
|
86
|
+
|
87
|
+
Requires Python 3.10+:
|
88
|
+
|
89
|
+
```bash
|
90
|
+
pip install cinchdb
|
91
|
+
```
|
92
|
+
|
93
|
+
## Quick Start
|
94
|
+
|
95
|
+
### CLI Usage
|
96
|
+
|
97
|
+
```bash
|
98
|
+
# Initialize project
|
99
|
+
cinch init my_app
|
100
|
+
cd my_app
|
101
|
+
|
102
|
+
# Create schema on feature branch
|
103
|
+
cinch branch create user-system
|
104
|
+
cinch table create users username:TEXT email:TEXT
|
105
|
+
cinch view create active_users "SELECT * FROM users WHERE created_at > datetime('now', '-30 days')"
|
106
|
+
|
107
|
+
# Merge to main
|
108
|
+
cinch branch merge-into-main user-system
|
109
|
+
|
110
|
+
# Multi-tenant operations
|
111
|
+
cinch tenant create customer_a
|
112
|
+
cinch tenant create customer_b
|
113
|
+
cinch query "SELECT COUNT(*) FROM users" --tenant customer_a
|
114
|
+
```
|
115
|
+
|
116
|
+
### Python SDK
|
117
|
+
|
118
|
+
```python
|
119
|
+
import cinchdb
|
120
|
+
from cinchdb.models import Column
|
121
|
+
|
122
|
+
# Local connection
|
123
|
+
db = cinchdb.connect("myapp")
|
124
|
+
|
125
|
+
# Create schema
|
126
|
+
db.create_table("posts", [
|
127
|
+
Column(name="title", type="TEXT",nullable=False),
|
128
|
+
Column(name="content", type="TEXT")
|
129
|
+
])
|
130
|
+
|
131
|
+
# Query data
|
132
|
+
results = db.query("SELECT * FROM posts WHERE title LIKE ?", ["%python%"])
|
133
|
+
|
134
|
+
# CRUD operations
|
135
|
+
post_id = db.insert("posts", {"title": "Hello World", "content": "First post"})
|
136
|
+
db.update("posts", post_id, {"content": "Updated content"})
|
137
|
+
```
|
138
|
+
|
139
|
+
### Remote API
|
140
|
+
|
141
|
+
```python
|
142
|
+
# Connect to remote API
|
143
|
+
db = cinchdb.connect_api("https://api.example.com", "your-api-key", "myapp")
|
144
|
+
|
145
|
+
# Same interface as local
|
146
|
+
results = db.query("SELECT * FROM users")
|
147
|
+
user_id = db.insert("users", {"username": "alice", "email": "alice@example.com"})
|
148
|
+
```
|
149
|
+
|
150
|
+
## API Server
|
151
|
+
|
152
|
+
Start the server:
|
153
|
+
|
154
|
+
```bash
|
155
|
+
cinch-server serve --create-key
|
156
|
+
# Creates API key (works after shutdown as well) and starts server on http://localhost:8000
|
157
|
+
```
|
158
|
+
|
159
|
+
Interactive docs at `/docs`, health check at `/health`.
|
160
|
+
|
161
|
+
## Architecture
|
162
|
+
|
163
|
+
- **Python SDK**: Core functionality (local + remote)
|
164
|
+
- **CLI**: Full-featured command-line interface
|
165
|
+
- **FastAPI Server**: REST API with authentication
|
166
|
+
- **TypeScript SDK**: Browser and Node.js client
|
167
|
+
|
168
|
+
## Development
|
169
|
+
|
170
|
+
```bash
|
171
|
+
git clone https://github.com/russellromney/cinchdb.git
|
172
|
+
cd cinchdb
|
173
|
+
make install-all
|
174
|
+
make test
|
175
|
+
```
|
176
|
+
|
177
|
+
## Future
|
178
|
+
|
179
|
+
Though probably not, perhaps I'll evolve it into something bigger and more full-featured, with things like
|
180
|
+
- data backups
|
181
|
+
- replication to S3
|
182
|
+
- audit access
|
183
|
+
- SaaS-like dynamics
|
184
|
+
- multi-project hosting
|
185
|
+
- auth proxying
|
186
|
+
- leader-follower abilities for edge deployment
|
187
|
+
|
188
|
+
|
189
|
+
## License
|
190
|
+
|
191
|
+
Apache 2.0 - see [LICENSE](LICENSE)
|
192
|
+
|
193
|
+
---
|
194
|
+
|
195
|
+
**CinchDB** - Database management as easy as version control
|
@@ -0,0 +1,68 @@
|
|
1
|
+
cinchdb/__init__.py,sha256=NZdSzfhRguSBTjJ2dcESOQYy53OZEuBndlB7U08GMY0,179
|
2
|
+
cinchdb/__main__.py,sha256=OpkDqn9zkTZhhYgvv_grswWLAHKbmxs4M-8C6Z5HfWY,85
|
3
|
+
cinchdb/config.py,sha256=Exzf0hCJgcg0PRRQz8EG7XFipx6fIVKO7IsQhpc0Q4o,6187
|
4
|
+
cinchdb/api/__init__.py,sha256=5AHDlOXOxxzyI8pW7puntIILp8E7HOy4D62odLN518w,79
|
5
|
+
cinchdb/api/app.py,sha256=iL9tYWYpJAAOzH9UHNbpl82Ibwz_zBCqxDXqARmxjbc,2172
|
6
|
+
cinchdb/api/auth.py,sha256=uxRWWRjE6sQWNPH6BBsdHT_PlWN_iYr_hh76tVG9fTY,8167
|
7
|
+
cinchdb/api/main.py,sha256=FpqhO7zTgh-r6y14mL0Cp-fGQ0TMmxPKCF7cNjDiCcw,4509
|
8
|
+
cinchdb/api/routers/__init__.py,sha256=o4xLUjKRKYnBU-RQiDXQotKml0lZEwIudU5S5bW4gt8,323
|
9
|
+
cinchdb/api/routers/auth.py,sha256=6Si_iQtDwj487Hv87AoV4vMWAJFnvd5JsFXghYqA7ao,3842
|
10
|
+
cinchdb/api/routers/branches.py,sha256=gEYBDqvwSzt5uSSVDo_mo2ysLfUqaavyDClpzRfYTyA,11537
|
11
|
+
cinchdb/api/routers/codegen.py,sha256=As9zfBmT7SMx1lrQfRg8TGofcRSOo_r77fCLmxuYkI4,5069
|
12
|
+
cinchdb/api/routers/columns.py,sha256=bWMIInp0Ma9KPp7PHFSr25ROWNKjOkwl9KNc3bQeqMo,8313
|
13
|
+
cinchdb/api/routers/data.py,sha256=rYnh6TwgLArA85AalOydg4txoXD0UWEItAvISuRVTao,14923
|
14
|
+
cinchdb/api/routers/databases.py,sha256=I6yolh9IoqOoMrhWFFyCDFuKtLGgQGxL2dwEj2FEYeQ,5024
|
15
|
+
cinchdb/api/routers/projects.py,sha256=70nwkXjGiK_pfTr6hv50viOjvQgv5yfC50mEgTByClE,3847
|
16
|
+
cinchdb/api/routers/query.py,sha256=UEtdKLIeo5OjOHfJl3IU3q2o69NOAX0pCyOwb7ivquQ,5120
|
17
|
+
cinchdb/api/routers/tables.py,sha256=Dg0ANMEVHXZyIO-mJBQCnJKfdRORKFqKaunLfJ_cTlo,10403
|
18
|
+
cinchdb/api/routers/tenants.py,sha256=1xukbM5avvkr1CMuq1pr78CNyE_9xk2Yg35mZFDvl-c,5692
|
19
|
+
cinchdb/api/routers/views.py,sha256=pzovkLttjEAg0ecvPwaN5qFgBqNhD0_g0sqq9UNYAmc,6051
|
20
|
+
cinchdb/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
|
+
cinchdb/cli/main.py,sha256=_vBSigtAcYgGBB4qRt2p3ZH8QZ4Osk5rLRe5cOD5ryU,4335
|
22
|
+
cinchdb/cli/utils.py,sha256=Alh3plAiVOGSk_ETqTmh2rYHHFULelizsQOR4e-_KJw,5661
|
23
|
+
cinchdb/cli/commands/__init__.py,sha256=gQ6tnU0Rvm0-ESWFUBU-KDl5dpNOpUTG509hXOQQjwY,27
|
24
|
+
cinchdb/cli/commands/branch.py,sha256=8sjumH0XPi8wYNltDH4HXlzRpcr-GHNAaw8zzmIYYus,17622
|
25
|
+
cinchdb/cli/commands/codegen.py,sha256=WsRWmXNTDuaLPyECW5psXM9zOQnKHpUiv8BJnBAjMII,6189
|
26
|
+
cinchdb/cli/commands/column.py,sha256=CQJZ-mkv_qaBnZDrNhKaunUdxVyz5zmbsZakUnz5-dg,11634
|
27
|
+
cinchdb/cli/commands/database.py,sha256=qn1i0o_sRVID-yjIPYib1l9_7Qun0zzKvsqdLH1-Mcw,6597
|
28
|
+
cinchdb/cli/commands/query.py,sha256=yce0rvp3WQCzFA08cP1DoP2Yir4NSYxX1XxXPmmo3lM,5120
|
29
|
+
cinchdb/cli/commands/remote.py,sha256=LecazBIlEAx8J85vONDrQyy3OEYkmYGCeTGS-c0PD1Y,4500
|
30
|
+
cinchdb/cli/commands/table.py,sha256=ApDcn-iJ-Cjsf4ubQh8UVNBxJmhLQ_O2FxQeBRk6xMI,10511
|
31
|
+
cinchdb/cli/commands/tenant.py,sha256=p6uReHyYh2Hl6ayWMHCTY_wUARcUHSl0n4Y20Nsi3gA,5752
|
32
|
+
cinchdb/cli/commands/view.py,sha256=ZmS1IW7idzzHAXmgVyY3C4IQRo7toHb6fHNFY_tQJjI,6385
|
33
|
+
cinchdb/cli/handlers/__init__.py,sha256=f2f-Cc96rSBLbVsiIbf-b4pZCKZoHfmhNEvnZ0OurRs,131
|
34
|
+
cinchdb/cli/handlers/codegen_handler.py,sha256=i5we_AbiUW3zfO6pIKWxvtO8OvOqz3H__4xPmTLEuQM,6524
|
35
|
+
cinchdb/core/__init__.py,sha256=7yh27tcLZAtTDGxz6wLtd-fnKZTXXlQE_3ZAY8FT8OU,148
|
36
|
+
cinchdb/core/connection.py,sha256=SlKyEfIpeaDws8M6SfEbvCEVnt26zBY1RYwHtTXj0kY,5110
|
37
|
+
cinchdb/core/database.py,sha256=QDz3imoCvrWAA4zLuYaM6lUNRKDQWrYAQPfIJyZkgyw,17984
|
38
|
+
cinchdb/core/maintenance.py,sha256=PAgrSL7Cj9p3rKHV0h_L7gupN6nLD0-5eQpJZNiqyEs,2097
|
39
|
+
cinchdb/core/path_utils.py,sha256=J2UEu1X_NFOqDamcsrPrC7ZitGTg9Y-HFjmx4sHf5j8,3806
|
40
|
+
cinchdb/managers/__init__.py,sha256=ic61ZUdsg-muq0ETYO6fuZRQWF4j7l920PthTkt2QrE,808
|
41
|
+
cinchdb/managers/branch.py,sha256=4rsusRQlLNfM55IS2dzosnVju7rbeJdaR9jcMPM9Bl8,5165
|
42
|
+
cinchdb/managers/change_applier.py,sha256=cHPhPgbJ9jeyrb6lkfRyumS8IHat0HiWfwZh-n7ButA,14310
|
43
|
+
cinchdb/managers/change_comparator.py,sha256=08pwybpSt36cFwhZRSIkHynvFMUaLKEVwa8Ajn_R9yQ,6862
|
44
|
+
cinchdb/managers/change_tracker.py,sha256=U93BPnuGv8xSaO5qr_y5Q8ppKrVXygozdp5zUvLUqwg,5054
|
45
|
+
cinchdb/managers/codegen.py,sha256=1CfIwjgHnNDdjrq4SzQ9VE7DFgnWfk7RtpupBFUTqxk,21804
|
46
|
+
cinchdb/managers/column.py,sha256=OvBm2irGhvIJEb2e5vSdBPQn5JUb0y9r89IsiMgQeeo,20858
|
47
|
+
cinchdb/managers/data.py,sha256=4wn9fxFPhrDvtudc1pdQmr0vf0w9H92VrzAIVyTXFCY,15408
|
48
|
+
cinchdb/managers/merge_manager.py,sha256=R8S2hLkLJg4hLDpeJTzjVkduZgqPOjXtYgOSJhTXXrE,15690
|
49
|
+
cinchdb/managers/query.py,sha256=c91J5FAR-Ze5Zy5HNEVIPvc8yuxe-xIv6XHH-lmdB2k,7307
|
50
|
+
cinchdb/managers/table.py,sha256=9Z_RJxZ9fMm_gYbmHXGG0-xZ0cNia1y5tusnydW66_U,13155
|
51
|
+
cinchdb/managers/tenant.py,sha256=sqLdfIqNkMBzM1b1iOYhVfgJqxhfzzjn5uoXOcP2bJg,8251
|
52
|
+
cinchdb/managers/view.py,sha256=v9gYtRufZyxywPKLGvIjvlUXcxYh9CLRArefu9QX6zk,7809
|
53
|
+
cinchdb/models/__init__.py,sha256=382OuS0BaKPA71GjqNW5lfVhtUYqmcMlLRin7HPi6XI,602
|
54
|
+
cinchdb/models/base.py,sha256=7j4rlFTP5K9ZuF8vxwC7lMFEaL7O90NJ47Ig5i7ubcw,1320
|
55
|
+
cinchdb/models/branch.py,sha256=nam76NJbLHHLbcQF2SaVADH7s2jrlFRGGRt_PDNhkwc,904
|
56
|
+
cinchdb/models/change.py,sha256=YpBWdI6yMT3uucd8duET9s75xr5JUWJqurkkyTlXPlk,1449
|
57
|
+
cinchdb/models/database.py,sha256=kIlvIoGlN3Hhk5UDHo2gKT9g4GCGfKHDL0cpVtoimc8,691
|
58
|
+
cinchdb/models/project.py,sha256=6GMXUZUsEIebqQJgRXIthWzpWKuNNmJ3drgI1vFDrMo,644
|
59
|
+
cinchdb/models/table.py,sha256=s6BGoHDuA-yzqQL9papRTVT2WcHjuY-SnoanGFDlFIE,2793
|
60
|
+
cinchdb/models/tenant.py,sha256=Y7_J_dFwwnXPM0EgF3J_g2M3guycfjqpdGEl03LG7p0,691
|
61
|
+
cinchdb/models/view.py,sha256=q6j-jYzFJuhRJO87rKt6Uv8hOizHQx8xwoPKoH6XnNY,530
|
62
|
+
cinchdb/utils/__init__.py,sha256=9VXzZBggOfzdj8DTdGBqqOxJzBAm-WS1M_zeToF1fgs,282
|
63
|
+
cinchdb/utils/sql_validator.py,sha256=7STxsVO7bD4gZ8mfimQSt4_Yfckw62plUS_X_xJ48Vo,5427
|
64
|
+
cinchdb-0.1.0.dist-info/METADATA,sha256=s9s1w2lUNuc2fQ-SqdHEcD2j6rzDjUhrxw8ZednTI6A,5998
|
65
|
+
cinchdb-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
66
|
+
cinchdb-0.1.0.dist-info/entry_points.txt,sha256=Zzlwp632_jT5OZBkrewvH3-RWUJ9E5vD_BNme6J-A1I,83
|
67
|
+
cinchdb-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
68
|
+
cinchdb-0.1.0.dist-info/RECORD,,
|
@@ -0,0 +1,201 @@
|
|
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 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 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 those 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
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|