Skip to content

Commit bb5b5a7

Browse files
author
App Generator
committed
Release v0.0.1 - Initial Version
1 parent cbcef30 commit bb5b5a7

File tree

3 files changed

+129
-1
lines changed

3 files changed

+129
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Change Log
2+
3+
4+
## [0.0.1] 2022-11-02
5+
### Minimal Version
6+
7+
- Initial Release

README.md

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,101 @@
1-
# devtool-db
1+
# DB Migration Tool
2+
3+
`Open-Source` project that provides simple helpers for database migrations.
4+
5+
<br />
6+
7+
> Features
8+
9+
- `Peewee` DB Reflection
10+
- Supported DB:
11+
- SQLite, MySql, PostgreSQL
12+
- DbWrapper Class:
13+
- `print_all_models()` - returns all tables
14+
- `print_db_model` - print table definition
15+
- `dump_tables()` - Dump SQL definitions (all tables)
16+
- `dump_tables_data()` - Dump database content (all tables)
17+
- [Support](https://appseed.us/support) via **Github** (issues tracker) and [Discord](https://discord.gg/fZC6hup).
18+
19+
<br />
20+
21+
## ✨ Quick Start
22+
23+
> Clone Sources (this repo)
24+
25+
```bash
26+
$ git clone https://github.com/app-generator/devtool-db.git
27+
$ cd devtool-db
28+
```
29+
30+
<br />
31+
32+
> Install Modules using a Virtual Environment
33+
34+
```bash
35+
$ virtualenv env
36+
$ source env/bin/activate
37+
$ pip install -r requirements.txt
38+
```
39+
40+
Or for **Windows-based Systems**
41+
42+
```bash
43+
$ virtualenv env
44+
$ .\env\Scripts\activate
45+
$
46+
$ # Install modules - SQLite Database
47+
$ pip3 install -r requirements.txt
48+
```
49+
50+
<br />
51+
52+
> Launch the Python console
53+
54+
```bash
55+
$ python
56+
>>>
57+
>>> from util import * # import helpers
58+
>>>
59+
>>> db_sqlite = DbWrapper() # invoke the Base Class
60+
>>> db_sqlite.driver = COMMON.DB_SQLITE # set driver
61+
>>> db_sqlite.db_name = 'samples/api-django.sqlite3' # set db name
62+
>>> db_sqlite.connect() # connect
63+
True
64+
>>> db_sqlite.load_models() # load DB SChema
65+
True
66+
>>> db_sqlite.dump_tables() # Dump tables definitions
67+
True
68+
>>> db_sqlite.dump_tables_data() # Dump data
69+
> Dump data for [api_user_user]
70+
> Dump data for [api_authentication_activesession]
71+
> Dump data for [auth_group]
72+
> Dump data for [api_user_user_groups]
73+
> Dump data for [django_content_type]
74+
> Dump data for [auth_permission]
75+
> Dump data for [api_user_user_user_permissions]
76+
> Dump data for [auth_group_permissions]
77+
> Dump data for [django_admin_log]
78+
> Dump data for [django_migrations]
79+
> Dump data for [django_session]
80+
True
81+
>>> db_sqlite.reset() # reset the Class data
82+
>>>
83+
```
84+
85+
<br />
86+
87+
At this point, the tables and data are saved in the `output` directory.
88+
89+
```bash
90+
$ cd output ; ls
91+
$ SQLITE.sql
92+
$ SQLITE_api_user_user.sql
93+
$ SQLITE_auth_permission.sql
94+
$ SQLITE_django_content_type.sql
95+
$ SQLITE_django_migrations.sql
96+
```
97+
98+
<br />
99+
100+
---
101+
DB Migration Tool - Provided by **AppSeed** [App Generator](https://appseed.us/app-generator).

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "devtool-db",
3+
"mastertemplate": "devtool-data-converter",
4+
"version": "0.0.1",
5+
"description": "Template project - Provided by AppSeed",
6+
"scripts": {},
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/app-generator/devtool-db"
10+
},
11+
"bugs": {
12+
"url": "https://github.com/app-generator/devtool-db/issues",
13+
"email": "support@appseed.us"
14+
},
15+
"author": "AppSeed App Generator <support@appseed.us> (https://appseed.us)",
16+
"engines": {
17+
"node": ">=10.0.0"
18+
},
19+
"dependencies": {},
20+
"devDependencies": {}
21+
}

0 commit comments

Comments
 (0)