Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mertguvencli/deploydb
A simple python package that performs SQL Server Source Control and Auto Deployment.
https://github.com/mertguvencli/deploydb
database dbops deployment-automation python sql-server version-control
Last synced: about 2 months ago
JSON representation
A simple python package that performs SQL Server Source Control and Auto Deployment.
- Host: GitHub
- URL: https://github.com/mertguvencli/deploydb
- Owner: mertguvencli
- License: other
- Created: 2021-10-14T23:53:36.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T21:04:09.000Z (about 2 years ago)
- Last Synced: 2024-11-08T14:51:36.293Z (3 months ago)
- Topics: database, dbops, deployment-automation, python, sql-server, version-control
- Language: Python
- Homepage: https://deploydb.readthedocs.io/en/latest/
- Size: 186 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.rst
- License: LICENSE
Awesome Lists containing this project
README
# deploydb
Deploy your database objects automatically when the git branch is updated.
* Production-ready! βοΈ
* Easy-to-use π¨
* Customizable π§## Installation
Install the latest package. `pip install deploydb`## Usage
1- Create configuration file ( *json file or `dict`* )|Property|Description|
|------------|-----------|
|`local_path`|where the local repository will be located|
|`https_url` or `ssh_url`|address to be listen|
|`target_branch`|branch to handle changes|
|`db_creds`|a list of server credentials|Example: `config.json`
```json
{
"local_path": "",
"https_url": "",
"ssh_url": "",
"target_branch": "main",
"db_creds": {
"driver": "ODBC Driver 17 for SQL Server",
"server": "server-address-or-instance-name",
"user": "your-username",
"passw": "your-password"
}
}
```2- Listener will listen every changes with `handle_changes` method.
```python
from deploydb import Listenerdeploy = Listener('config.json')
deploy.handle_changes()
```### Repo Generator
If you does not have any existing repository. You can easily export your database objects then create your repository.
```python
from deploydb import RepoGeneratorscripter = RepoGenerator(
config="config.json",
export_path="path-to-export",
includes=[], #Β Default takes all databases from the given credential if not specified.
excludes=[]
)
scripter.run()
```
`RepoGenerator` will extract objects structure as below.```
.
βββ Databases
βΒ Β βββ Your-Db-Name
βΒ Β βΒ Β βββ DDLs
βΒ Β βΒ Β βββ DMLs
βΒ Β βΒ Β βββ Functions
βΒ Β βΒ Β βββ Stored-Procedures
βΒ Β βΒ Β βββ Tables
βΒ Β βΒ Β βββ Triggers
βΒ Β βΒ Β βββ Types
βΒ Β βΒ Β βββ Views
βΒ Β βββ Database-N
βββ README.md
```## TODO
* Creating Services for Continuous Integration
* Windows Service
* Linux Systemd Service* Getting Notifications
* Microsoft Teams Webhook Integration
* Slack Webhook Integration