db-git 0.1.0__tar.gz → 0.1.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.
Files changed (62) hide show
  1. {db_git-0.1.0 → db_git-0.1.1}/.claude/settings.local.json +4 -1
  2. {db_git-0.1.0 → db_git-0.1.1}/CHANGELOG.md +9 -2
  3. {db_git-0.1.0 → db_git-0.1.1}/PKG-INFO +52 -52
  4. {db_git-0.1.0 → db_git-0.1.1}/README.md +46 -46
  5. {db_git-0.1.0 → db_git-0.1.1}/noxfile.py +1 -1
  6. {db_git-0.1.0 → db_git-0.1.1}/pyproject.toml +8 -8
  7. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/backends/__init__.py +9 -9
  8. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/backends/postgresql/backend.py +10 -10
  9. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/backends/postgresql/branch_db.py +10 -10
  10. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/backends/postgresql/connections.py +4 -4
  11. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/backends/postgresql/pgdump.py +10 -10
  12. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/backends/postgresql/template.py +9 -9
  13. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/cli/__init__.py +1 -1
  14. db_git-0.1.1/src/db_git/cli/_common.py +41 -0
  15. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/cli/_console.py +1 -1
  16. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/cli/_prompts.py +1 -1
  17. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/cli/branch.py +13 -13
  18. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/cli/hook.py +13 -13
  19. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/cli/init.py +16 -16
  20. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/cli/inspect.py +21 -21
  21. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/cli/snapshot.py +11 -11
  22. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/config.py +29 -29
  23. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/errors.py +9 -9
  24. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/git.py +20 -20
  25. db_git-0.1.1/src/db_git/hook_script.py +49 -0
  26. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/state.py +11 -11
  27. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/storage.py +7 -7
  28. {db_git-0.1.0 → db_git-0.1.1}/tests/_pg_helpers.py +11 -11
  29. {db_git-0.1.0 → db_git-0.1.1}/tests/conftest.py +4 -4
  30. {db_git-0.1.0 → db_git-0.1.1}/tests/e2e/_helpers.py +3 -3
  31. {db_git-0.1.0 → db_git-0.1.1}/tests/e2e/test_per_branch_pgdump_workflow.py +36 -36
  32. {db_git-0.1.0 → db_git-0.1.1}/tests/e2e/test_per_branch_template_workflow.py +37 -37
  33. {db_git-0.1.0 → db_git-0.1.1}/tests/e2e/test_shared_pgdump_workflow.py +64 -64
  34. {db_git-0.1.0 → db_git-0.1.1}/tests/e2e/test_shared_template_workflow.py +69 -69
  35. {db_git-0.1.0 → db_git-0.1.1}/tests/integration/conftest.py +11 -11
  36. {db_git-0.1.0 → db_git-0.1.1}/tests/integration/test_branch_db.py +6 -6
  37. {db_git-0.1.0 → db_git-0.1.1}/tests/integration/test_connections.py +9 -9
  38. {db_git-0.1.0 → db_git-0.1.1}/tests/integration/test_pgdump_strategy.py +11 -11
  39. {db_git-0.1.0 → db_git-0.1.1}/tests/integration/test_template_strategy.py +14 -14
  40. {db_git-0.1.0 → db_git-0.1.1}/tests/unit/test_cli.py +28 -28
  41. {db_git-0.1.0 → db_git-0.1.1}/tests/unit/test_config.py +32 -32
  42. {db_git-0.1.0 → db_git-0.1.1}/tests/unit/test_db.py +1 -1
  43. {db_git-0.1.0 → db_git-0.1.1}/tests/unit/test_git.py +4 -4
  44. {db_git-0.1.0 → db_git-0.1.1}/tests/unit/test_state.py +7 -7
  45. {db_git-0.1.0 → db_git-0.1.1}/tests/unit/test_storage.py +4 -4
  46. {db_git-0.1.0 → db_git-0.1.1}/uv.lock +41 -41
  47. db_git-0.1.0/src/git_db/cli/_common.py +0 -41
  48. db_git-0.1.0/src/git_db/hook_script.py +0 -49
  49. {db_git-0.1.0 → db_git-0.1.1}/.github/dependabot.yml +0 -0
  50. {db_git-0.1.0 → db_git-0.1.1}/.github/workflows/test.yml +0 -0
  51. {db_git-0.1.0 → db_git-0.1.1}/.gitignore +0 -0
  52. {db_git-0.1.0 → db_git-0.1.1}/.pre-commit-config.yaml +0 -0
  53. {db_git-0.1.0 → db_git-0.1.1}/LICENSE +0 -0
  54. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/__init__.py +0 -0
  55. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/backends/postgresql/__init__.py +0 -0
  56. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/cli/_format.py +0 -0
  57. {db_git-0.1.0/src/git_db → db_git-0.1.1/src/db_git}/db.py +0 -0
  58. {db_git-0.1.0 → db_git-0.1.1}/tests/__init__.py +0 -0
  59. {db_git-0.1.0 → db_git-0.1.1}/tests/e2e/__init__.py +0 -0
  60. {db_git-0.1.0 → db_git-0.1.1}/tests/e2e/conftest.py +0 -0
  61. {db_git-0.1.0 → db_git-0.1.1}/tests/integration/__init__.py +0 -0
  62. {db_git-0.1.0 → db_git-0.1.1}/tests/unit/__init__.py +0 -0
@@ -20,7 +20,10 @@
20
20
  "Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); [print\\(x['name']\\) for x in d] if isinstance\\(d,list\\) else print\\(d\\)\")",
21
21
  "Bash(curl -s \"https://api.github.com/repos/dbt-labs/dbt-adapters/git/trees/main?recursive=1\")",
22
22
  "Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); [print\\(x['path']\\) for x in d.get\\('tree',[]\\) if 'fixtures' in x['path'] and x['path'].endswith\\('.py'\\)]\")",
23
- "Bash(python -c \"import typer, click; print\\('typer.Exit MRO:', [c.__name__ for c in typer.Exit.__mro__]\\); print\\('is Exception subclass:', issubclass\\(typer.Exit, Exception\\)\\)\")"
23
+ "Bash(python -c \"import typer, click; print\\('typer.Exit MRO:', [c.__name__ for c in typer.Exit.__mro__]\\); print\\('is Exception subclass:', issubclass\\(typer.Exit, Exception\\)\\)\")",
24
+ "Bash(rtk grep *)",
25
+ "Bash(rtk read *)",
26
+ "Bash(rtk git *)"
24
27
  ]
25
28
  }
26
29
  }
@@ -9,7 +9,7 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht
9
9
 
10
10
  ### Added
11
11
 
12
- - Initial `git-db` command-line interface.
12
+ - Initial `db-git` command-line interface.
13
13
  - Git `post-checkout` hook installation, removal, enable, disable, and dispatch
14
14
  support.
15
15
  - Shared database mode for saving and restoring branch-specific snapshots.
@@ -18,8 +18,15 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht
18
18
  - Active connection handling with `terminate` and `fail` policies.
19
19
  - Manual commands for `save`, `restore`, `create`, `reset`, `list`, `status`,
20
20
  and `prune`.
21
- - Snapshot metadata and local state storage under `.git/git-db/`.
21
+ - Snapshot metadata and local state storage under `.git/db-git/`.
22
22
  - Unit, integration, and end-to-end tests for CLI, storage, git hooks,
23
23
  PostgreSQL strategies, and branch database workflows.
24
24
  - Nox sessions, Ruff linting/format checks, mypy type checking, pre-commit
25
25
  hooks, Dependabot, and GitHub Actions CI.
26
+
27
+ ## [0.1.1] - 2026-06-01
28
+
29
+ ### Changed
30
+
31
+ - Renamed project, CLI, package imports, configuration files, environment
32
+ variables, hook metadata, and local state paths to `db-git`.
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: db-git
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Keep your database in sync with your git branches.
5
- Project-URL: Homepage, https://github.com/earthcomfy/git-db
6
- Project-URL: Repository, https://github.com/earthcomfy/git-db
7
- Project-URL: Issues, https://github.com/earthcomfy/git-db/issues
8
- Project-URL: Changelog, https://github.com/earthcomfy/git-db/blob/main/CHANGELOG.md
5
+ Project-URL: Homepage, https://github.com/earthcomfy/db-git
6
+ Project-URL: Repository, https://github.com/earthcomfy/db-git
7
+ Project-URL: Issues, https://github.com/earthcomfy/db-git/issues
8
+ Project-URL: Changelog, https://github.com/earthcomfy/db-git/blob/main/CHANGELOG.md
9
9
  Author: Hana Belay
10
10
  License-Expression: MIT
11
11
  License-File: LICENSE
12
12
  Keywords: branching,cli,database,developer-tools,git,migrations,postgresql,snapshot
13
- Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Development Status :: 4 - Beta
14
14
  Classifier: Environment :: Console
15
15
  Classifier: Intended Audience :: Developers
16
16
  Classifier: License :: OSI Approved :: MIT License
@@ -29,15 +29,15 @@ Requires-Dist: tomlkit>=0.14.0
29
29
  Requires-Dist: typer>=0.24.1
30
30
  Description-Content-Type: text/markdown
31
31
 
32
- # git-db
32
+ # db-git
33
33
 
34
- [![CI](https://github.com/earthcomfy/git-db/actions/workflows/test.yml/badge.svg)](https://github.com/earthcomfy/git-db/actions/workflows/test.yml)
35
- [![Python](https://img.shields.io/pypi/pyversions/git-db.svg)](https://pypi.org/project/git-db/)
34
+ [![CI](https://github.com/earthcomfy/db-git/actions/workflows/test.yml/badge.svg)](https://github.com/earthcomfy/db-git/actions/workflows/test.yml)
35
+ [![Python](https://img.shields.io/pypi/pyversions/db-git.svg)](https://pypi.org/project/db-git/)
36
36
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
37
37
 
38
38
  Keep your database in sync with your git branches.
39
39
 
40
- `git-db` is a developer tool for projects where database state follows code
40
+ `db-git` is a developer tool for projects where database state follows code
41
41
  changes: schema migrations, seed data, experimental feature work, and branch
42
42
  switching during reviews. It installs a git `post-checkout` hook and keeps your
43
43
  local database aligned with the branch you are working on.
@@ -57,19 +57,19 @@ local database aligned with the branch you are working on.
57
57
  - `pgdump`: portable snapshots using `pg_dump` and `pg_restore`
58
58
  - Manual `save`, `restore`, `create`, `reset`, `list`, `status`, and `prune`
59
59
  commands
60
- - Safe hook behavior: checkout is never blocked by git-db failures
61
- - Rich terminal output and local state stored under `.git/git-db/`
60
+ - Safe hook behavior: checkout is never blocked by db-git failures
61
+ - Rich terminal output and local state stored under `.git/db-git/`
62
62
 
63
63
  ## Quick Start
64
64
 
65
65
  ```bash
66
- uv tool install git-db # or pip install git-db
66
+ uv tool install db-git # or pip install db-git
67
67
  ```
68
68
 
69
69
  Run this from inside a git repository:
70
70
 
71
71
  ```bash
72
- git-db init --database-url postgresql://postgres:postgres@localhost:5432/myapp
72
+ db-git init --database-url postgresql://postgres:postgres@localhost:5432/myapp
73
73
  ```
74
74
 
75
75
  Interactive init will ask:
@@ -85,10 +85,10 @@ After setup, switch branches normally:
85
85
  git checkout feature/auth
86
86
  ```
87
87
 
88
- In `shared` mode, git-db saves the previous branch database and restores the
88
+ In `shared` mode, db-git saves the previous branch database and restores the
89
89
  new branch snapshot if one exists.
90
90
 
91
- In `per-branch` mode, git-db creates or selects a database named from the
91
+ In `per-branch` mode, db-git creates or selects a database named from the
92
92
  current branch, for example:
93
93
 
94
94
  ```text
@@ -109,7 +109,7 @@ Use this when:
109
109
 
110
110
  - You want one familiar local database name
111
111
  - You want branch-specific snapshots
112
- - You are comfortable with git-db dropping and restoring that local database
112
+ - You are comfortable with db-git dropping and restoring that local database
113
113
  during branch switches
114
114
 
115
115
  ### Per-Branch Mode
@@ -148,13 +148,13 @@ not available. It requires PostgreSQL client tools to be installed locally.
148
148
  ### Initialize
149
149
 
150
150
  ```bash
151
- git-db init --database-url postgresql://user:password@localhost:5432/myapp
151
+ db-git init --database-url postgresql://user:password@localhost:5432/myapp
152
152
  ```
153
153
 
154
154
  Useful options:
155
155
 
156
156
  ```bash
157
- git-db init \
157
+ db-git init \
158
158
  --database-url postgresql://user:password@localhost:5432/myapp \
159
159
  --mode per-branch \
160
160
  --strategy template \
@@ -164,14 +164,14 @@ git-db init \
164
164
  Skip hook installation:
165
165
 
166
166
  ```bash
167
- git-db init --database-url postgresql://localhost/myapp --no-hook
167
+ db-git init --database-url postgresql://localhost/myapp --no-hook
168
168
  ```
169
169
 
170
170
  ### Inspect State
171
171
 
172
172
  ```bash
173
- git-db status
174
- git-db list
173
+ db-git status
174
+ db-git list
175
175
  ```
176
176
 
177
177
  ### Shared Mode Commands
@@ -179,20 +179,20 @@ git-db list
179
179
  Save the current branch database:
180
180
 
181
181
  ```bash
182
- git-db save
182
+ db-git save
183
183
  ```
184
184
 
185
185
  Restore the current branch database:
186
186
 
187
187
  ```bash
188
- git-db restore
188
+ db-git restore
189
189
  ```
190
190
 
191
191
  Save or restore a specific branch:
192
192
 
193
193
  ```bash
194
- git-db save main
195
- git-db restore feature/auth
194
+ db-git save main
195
+ db-git restore feature/auth
196
196
  ```
197
197
 
198
198
  ### Per-Branch Commands
@@ -200,13 +200,13 @@ git-db restore feature/auth
200
200
  Create a branch database before checking out the branch:
201
201
 
202
202
  ```bash
203
- git-db create feature/auth
203
+ db-git create feature/auth
204
204
  ```
205
205
 
206
206
  Drop and recreate a branch database from the seed database:
207
207
 
208
208
  ```bash
209
- git-db reset feature/auth
209
+ db-git reset feature/auth
210
210
  ```
211
211
 
212
212
  The default branch database cannot be reset because it is the seed for other
@@ -217,13 +217,13 @@ branch databases.
217
217
  Preview stale snapshots or branch databases:
218
218
 
219
219
  ```bash
220
- git-db prune --dry-run
220
+ db-git prune --dry-run
221
221
  ```
222
222
 
223
223
  Remove stale snapshots or branch databases:
224
224
 
225
225
  ```bash
226
- git-db prune --yes
226
+ db-git prune --yes
227
227
  ```
228
228
 
229
229
  ### Hook Management
@@ -231,31 +231,31 @@ git-db prune --yes
231
231
  Install or reinstall the checkout hook:
232
232
 
233
233
  ```bash
234
- git-db hook install
234
+ db-git hook install
235
235
  ```
236
236
 
237
237
  Remove the checkout hook:
238
238
 
239
239
  ```bash
240
- git-db hook remove
240
+ db-git hook remove
241
241
  ```
242
242
 
243
- Temporarily disable git-db without removing the hook:
243
+ Temporarily disable db-git without removing the hook:
244
244
 
245
245
  ```bash
246
- git-db disable
247
- git-db enable
246
+ db-git disable
247
+ db-git enable
248
248
  ```
249
249
 
250
250
  You can also skip hook behavior for a single checkout:
251
251
 
252
252
  ```bash
253
- GIT_DB_SKIP=1 git checkout other-branch
253
+ DB_GIT_SKIP=1 git checkout other-branch
254
254
  ```
255
255
 
256
256
  ## Configuration
257
257
 
258
- `git-db init` writes `.git-db.toml` at the repository root.
258
+ `db-git init` writes `.db-git.toml` at the repository root.
259
259
 
260
260
  Example:
261
261
 
@@ -276,14 +276,14 @@ Supported configuration keys:
276
276
  | `default_branch` | Seed branch for per-branch mode | `main` |
277
277
  | `strategy` | `template` or `pgdump` | required |
278
278
  | `on_active_connections` | `terminate` or `fail` | `terminate` |
279
- | `snapshot_dir` | Shared-mode snapshot metadata/dump directory | `.git/git-db/snapshots` |
279
+ | `snapshot_dir` | Shared-mode snapshot metadata/dump directory | `.git/db-git/snapshots` |
280
280
  | `max_snapshots` | Snapshot count kept by prune logic | `20` |
281
281
  | `force_terminate_timeout_ms` | Active connection termination timeout | `5000` |
282
282
 
283
283
  Configuration precedence:
284
284
 
285
285
  1. Built-in defaults
286
- 2. `.git-db.toml`
286
+ 2. `.db-git.toml`
287
287
  3. Environment variables
288
288
  4. CLI options
289
289
 
@@ -291,16 +291,16 @@ Environment variables:
291
291
 
292
292
  ```bash
293
293
  DATABASE_URL
294
- GIT_DB_DATABASE_URL
295
- GIT_DB_MODE
296
- GIT_DB_STRATEGY
297
- GIT_DB_ON_ACTIVE_CONNECTIONS
298
- GIT_DB_SNAPSHOT_DIR
299
- GIT_DB_MAX_SNAPSHOTS
300
- GIT_DB_FORCE_TERMINATE_TIMEOUT_MS
294
+ DB_GIT_DATABASE_URL
295
+ DB_GIT_MODE
296
+ DB_GIT_STRATEGY
297
+ DB_GIT_ON_ACTIVE_CONNECTIONS
298
+ DB_GIT_SNAPSHOT_DIR
299
+ DB_GIT_MAX_SNAPSHOTS
300
+ DB_GIT_FORCE_TERMINATE_TIMEOUT_MS
301
301
  ```
302
302
 
303
- `GIT_DB_DATABASE_URL` takes precedence over `DATABASE_URL`.
303
+ `DB_GIT_DATABASE_URL` takes precedence over `DATABASE_URL`.
304
304
 
305
305
  ### Active connections block an operation
306
306
 
@@ -316,24 +316,24 @@ on_active_connections = "terminate"
316
316
  Your PostgreSQL user may need superuser privileges or membership in
317
317
  `pg_signal_backend` to terminate sessions owned by other users.
318
318
 
319
- ### Temporarily skip git-db
319
+ ### Temporarily skip db-git
320
320
 
321
321
  ```bash
322
- git-db disable
322
+ db-git disable
323
323
  git checkout some-branch
324
- git-db enable
324
+ db-git enable
325
325
  ```
326
326
 
327
327
  Or for one command:
328
328
 
329
329
  ```bash
330
- GIT_DB_SKIP=1 git checkout some-branch
330
+ DB_GIT_SKIP=1 git checkout some-branch
331
331
  ```
332
332
 
333
333
  ### Show full tracebacks
334
334
 
335
335
  ```bash
336
- GIT_DB_DEBUG=1 git-db status
336
+ DB_GIT_DEBUG=1 db-git status
337
337
  ```
338
338
 
339
339
  ## Development
@@ -1,12 +1,12 @@
1
- # git-db
1
+ # db-git
2
2
 
3
- [![CI](https://github.com/earthcomfy/git-db/actions/workflows/test.yml/badge.svg)](https://github.com/earthcomfy/git-db/actions/workflows/test.yml)
4
- [![Python](https://img.shields.io/pypi/pyversions/git-db.svg)](https://pypi.org/project/git-db/)
3
+ [![CI](https://github.com/earthcomfy/db-git/actions/workflows/test.yml/badge.svg)](https://github.com/earthcomfy/db-git/actions/workflows/test.yml)
4
+ [![Python](https://img.shields.io/pypi/pyversions/db-git.svg)](https://pypi.org/project/db-git/)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
6
 
7
7
  Keep your database in sync with your git branches.
8
8
 
9
- `git-db` is a developer tool for projects where database state follows code
9
+ `db-git` is a developer tool for projects where database state follows code
10
10
  changes: schema migrations, seed data, experimental feature work, and branch
11
11
  switching during reviews. It installs a git `post-checkout` hook and keeps your
12
12
  local database aligned with the branch you are working on.
@@ -26,19 +26,19 @@ local database aligned with the branch you are working on.
26
26
  - `pgdump`: portable snapshots using `pg_dump` and `pg_restore`
27
27
  - Manual `save`, `restore`, `create`, `reset`, `list`, `status`, and `prune`
28
28
  commands
29
- - Safe hook behavior: checkout is never blocked by git-db failures
30
- - Rich terminal output and local state stored under `.git/git-db/`
29
+ - Safe hook behavior: checkout is never blocked by db-git failures
30
+ - Rich terminal output and local state stored under `.git/db-git/`
31
31
 
32
32
  ## Quick Start
33
33
 
34
34
  ```bash
35
- uv tool install git-db # or pip install git-db
35
+ uv tool install db-git # or pip install db-git
36
36
  ```
37
37
 
38
38
  Run this from inside a git repository:
39
39
 
40
40
  ```bash
41
- git-db init --database-url postgresql://postgres:postgres@localhost:5432/myapp
41
+ db-git init --database-url postgresql://postgres:postgres@localhost:5432/myapp
42
42
  ```
43
43
 
44
44
  Interactive init will ask:
@@ -54,10 +54,10 @@ After setup, switch branches normally:
54
54
  git checkout feature/auth
55
55
  ```
56
56
 
57
- In `shared` mode, git-db saves the previous branch database and restores the
57
+ In `shared` mode, db-git saves the previous branch database and restores the
58
58
  new branch snapshot if one exists.
59
59
 
60
- In `per-branch` mode, git-db creates or selects a database named from the
60
+ In `per-branch` mode, db-git creates or selects a database named from the
61
61
  current branch, for example:
62
62
 
63
63
  ```text
@@ -78,7 +78,7 @@ Use this when:
78
78
 
79
79
  - You want one familiar local database name
80
80
  - You want branch-specific snapshots
81
- - You are comfortable with git-db dropping and restoring that local database
81
+ - You are comfortable with db-git dropping and restoring that local database
82
82
  during branch switches
83
83
 
84
84
  ### Per-Branch Mode
@@ -117,13 +117,13 @@ not available. It requires PostgreSQL client tools to be installed locally.
117
117
  ### Initialize
118
118
 
119
119
  ```bash
120
- git-db init --database-url postgresql://user:password@localhost:5432/myapp
120
+ db-git init --database-url postgresql://user:password@localhost:5432/myapp
121
121
  ```
122
122
 
123
123
  Useful options:
124
124
 
125
125
  ```bash
126
- git-db init \
126
+ db-git init \
127
127
  --database-url postgresql://user:password@localhost:5432/myapp \
128
128
  --mode per-branch \
129
129
  --strategy template \
@@ -133,14 +133,14 @@ git-db init \
133
133
  Skip hook installation:
134
134
 
135
135
  ```bash
136
- git-db init --database-url postgresql://localhost/myapp --no-hook
136
+ db-git init --database-url postgresql://localhost/myapp --no-hook
137
137
  ```
138
138
 
139
139
  ### Inspect State
140
140
 
141
141
  ```bash
142
- git-db status
143
- git-db list
142
+ db-git status
143
+ db-git list
144
144
  ```
145
145
 
146
146
  ### Shared Mode Commands
@@ -148,20 +148,20 @@ git-db list
148
148
  Save the current branch database:
149
149
 
150
150
  ```bash
151
- git-db save
151
+ db-git save
152
152
  ```
153
153
 
154
154
  Restore the current branch database:
155
155
 
156
156
  ```bash
157
- git-db restore
157
+ db-git restore
158
158
  ```
159
159
 
160
160
  Save or restore a specific branch:
161
161
 
162
162
  ```bash
163
- git-db save main
164
- git-db restore feature/auth
163
+ db-git save main
164
+ db-git restore feature/auth
165
165
  ```
166
166
 
167
167
  ### Per-Branch Commands
@@ -169,13 +169,13 @@ git-db restore feature/auth
169
169
  Create a branch database before checking out the branch:
170
170
 
171
171
  ```bash
172
- git-db create feature/auth
172
+ db-git create feature/auth
173
173
  ```
174
174
 
175
175
  Drop and recreate a branch database from the seed database:
176
176
 
177
177
  ```bash
178
- git-db reset feature/auth
178
+ db-git reset feature/auth
179
179
  ```
180
180
 
181
181
  The default branch database cannot be reset because it is the seed for other
@@ -186,13 +186,13 @@ branch databases.
186
186
  Preview stale snapshots or branch databases:
187
187
 
188
188
  ```bash
189
- git-db prune --dry-run
189
+ db-git prune --dry-run
190
190
  ```
191
191
 
192
192
  Remove stale snapshots or branch databases:
193
193
 
194
194
  ```bash
195
- git-db prune --yes
195
+ db-git prune --yes
196
196
  ```
197
197
 
198
198
  ### Hook Management
@@ -200,31 +200,31 @@ git-db prune --yes
200
200
  Install or reinstall the checkout hook:
201
201
 
202
202
  ```bash
203
- git-db hook install
203
+ db-git hook install
204
204
  ```
205
205
 
206
206
  Remove the checkout hook:
207
207
 
208
208
  ```bash
209
- git-db hook remove
209
+ db-git hook remove
210
210
  ```
211
211
 
212
- Temporarily disable git-db without removing the hook:
212
+ Temporarily disable db-git without removing the hook:
213
213
 
214
214
  ```bash
215
- git-db disable
216
- git-db enable
215
+ db-git disable
216
+ db-git enable
217
217
  ```
218
218
 
219
219
  You can also skip hook behavior for a single checkout:
220
220
 
221
221
  ```bash
222
- GIT_DB_SKIP=1 git checkout other-branch
222
+ DB_GIT_SKIP=1 git checkout other-branch
223
223
  ```
224
224
 
225
225
  ## Configuration
226
226
 
227
- `git-db init` writes `.git-db.toml` at the repository root.
227
+ `db-git init` writes `.db-git.toml` at the repository root.
228
228
 
229
229
  Example:
230
230
 
@@ -245,14 +245,14 @@ Supported configuration keys:
245
245
  | `default_branch` | Seed branch for per-branch mode | `main` |
246
246
  | `strategy` | `template` or `pgdump` | required |
247
247
  | `on_active_connections` | `terminate` or `fail` | `terminate` |
248
- | `snapshot_dir` | Shared-mode snapshot metadata/dump directory | `.git/git-db/snapshots` |
248
+ | `snapshot_dir` | Shared-mode snapshot metadata/dump directory | `.git/db-git/snapshots` |
249
249
  | `max_snapshots` | Snapshot count kept by prune logic | `20` |
250
250
  | `force_terminate_timeout_ms` | Active connection termination timeout | `5000` |
251
251
 
252
252
  Configuration precedence:
253
253
 
254
254
  1. Built-in defaults
255
- 2. `.git-db.toml`
255
+ 2. `.db-git.toml`
256
256
  3. Environment variables
257
257
  4. CLI options
258
258
 
@@ -260,16 +260,16 @@ Environment variables:
260
260
 
261
261
  ```bash
262
262
  DATABASE_URL
263
- GIT_DB_DATABASE_URL
264
- GIT_DB_MODE
265
- GIT_DB_STRATEGY
266
- GIT_DB_ON_ACTIVE_CONNECTIONS
267
- GIT_DB_SNAPSHOT_DIR
268
- GIT_DB_MAX_SNAPSHOTS
269
- GIT_DB_FORCE_TERMINATE_TIMEOUT_MS
263
+ DB_GIT_DATABASE_URL
264
+ DB_GIT_MODE
265
+ DB_GIT_STRATEGY
266
+ DB_GIT_ON_ACTIVE_CONNECTIONS
267
+ DB_GIT_SNAPSHOT_DIR
268
+ DB_GIT_MAX_SNAPSHOTS
269
+ DB_GIT_FORCE_TERMINATE_TIMEOUT_MS
270
270
  ```
271
271
 
272
- `GIT_DB_DATABASE_URL` takes precedence over `DATABASE_URL`.
272
+ `DB_GIT_DATABASE_URL` takes precedence over `DATABASE_URL`.
273
273
 
274
274
  ### Active connections block an operation
275
275
 
@@ -285,24 +285,24 @@ on_active_connections = "terminate"
285
285
  Your PostgreSQL user may need superuser privileges or membership in
286
286
  `pg_signal_backend` to terminate sessions owned by other users.
287
287
 
288
- ### Temporarily skip git-db
288
+ ### Temporarily skip db-git
289
289
 
290
290
  ```bash
291
- git-db disable
291
+ db-git disable
292
292
  git checkout some-branch
293
- git-db enable
293
+ db-git enable
294
294
  ```
295
295
 
296
296
  Or for one command:
297
297
 
298
298
  ```bash
299
- GIT_DB_SKIP=1 git checkout some-branch
299
+ DB_GIT_SKIP=1 git checkout some-branch
300
300
  ```
301
301
 
302
302
  ### Show full tracebacks
303
303
 
304
304
  ```bash
305
- GIT_DB_DEBUG=1 git-db status
305
+ DB_GIT_DEBUG=1 db-git status
306
306
  ```
307
307
 
308
308
  ## Development
@@ -42,7 +42,7 @@ def integration(session: nox.Session, pg_image: str) -> None:
42
42
  if shutil.which("docker") is None:
43
43
  session.skip("docker not available")
44
44
  _install(session)
45
- session.env["GITDB_TEST_PG_IMAGE"] = pg_image
45
+ session.env["DB_GIT_TEST_PG_IMAGE"] = pg_image
46
46
  session.run(
47
47
  "pytest",
48
48
  "tests/integration",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "db-git"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "Keep your database in sync with your git branches."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -17,7 +17,7 @@ keywords = [
17
17
  "cli",
18
18
  ]
19
19
  classifiers = [
20
- "Development Status :: 3 - Alpha",
20
+ "Development Status :: 4 - Beta",
21
21
  "Environment :: Console",
22
22
  "Intended Audience :: Developers",
23
23
  "License :: OSI Approved :: MIT License",
@@ -49,20 +49,20 @@ dev = [
49
49
  ]
50
50
 
51
51
  [project.scripts]
52
- db-git = "git_db.cli:app"
52
+ db-git = "db_git.cli:app"
53
53
 
54
54
  [project.urls]
55
- Homepage = "https://github.com/earthcomfy/git-db"
56
- Repository = "https://github.com/earthcomfy/git-db"
57
- Issues = "https://github.com/earthcomfy/git-db/issues"
58
- Changelog = "https://github.com/earthcomfy/git-db/blob/main/CHANGELOG.md"
55
+ Homepage = "https://github.com/earthcomfy/db-git"
56
+ Repository = "https://github.com/earthcomfy/db-git"
57
+ Issues = "https://github.com/earthcomfy/db-git/issues"
58
+ Changelog = "https://github.com/earthcomfy/db-git/blob/main/CHANGELOG.md"
59
59
 
60
60
  [build-system]
61
61
  requires = ["hatchling"]
62
62
  build-backend = "hatchling.build"
63
63
 
64
64
  [tool.hatch.build.targets.wheel]
65
- packages = ["src/git_db"]
65
+ packages = ["src/db_git"]
66
66
 
67
67
  [tool.pytest.ini_options]
68
68
  markers = ["integration: integration tests", "e2e: end-to-end tests"]