Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pyquibase

Pyquibase is a Python wrapper for liquibase. There are other liquibase wrapper for python but they all require change log files to be in YAML format. Since I want to use xml file for liquibase, I built my own liquibase wrapper for python. Athough I use Pyquibase with xml files only, it should also work with other file types.

Installation

pip install pyquibase

Usage

Currently it supports Sqlite, MySql, and Postgresql

Update

sqlite
from pyquibase.pyquibase import Pyquibase

if __name__ == '__main__':
    pyquibase = Pyquibase.sqlite('test.sqlite', 'db-changelog-1.xml')
    pyquibase.update()
MySQL
from pyquibase.pyquibase import Pyquibase

if __name__ == '__main__':
    pyquibase = Pyquibase.mysql(
        host            = 'localhost',
        port            = 3306,
        db_name         = 'pyquibase',
        username        = 'root',
        password        = 'test',
        change_log_file = 'db-changelog-1.xml'
    )
    pyquibase.update()
Postgresql
from pyquibase.pyquibase import Pyquibase

if __name__ == '__main__':
    pyquibase = Pyquibase.postgresql(
        host            = 'localhost',
        port            = 3306,
        db_name         = 'pyquibase',
        username        = 'root',
        password        = 'test',
        change_log_file = 'db-changelog-1.xml'
    )
    pyquibase.update()

Rollback

pyquibase.rollback('tag')

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages