SQLiteFKTG4SA

SQLite Foreign Key Trigger Generator for SQLAlchemy
Download

SQLiteFKTG4SA Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Randy Syring

SQLiteFKTG4SA Tags


SQLiteFKTG4SA Description

SQLite Foreign Key Trigger Generator for SQLAlchemy The SQLiteFKTG4SA project exists because SQLite parses fk column constraints but does not enforce them. You can read more about the problem and its solution if you are interested. The gist of it all is that triggers can be used in SQLite to enforce fk column constraints. I had previously created a project to do this in PHP but have recently been trying to move to Python. Since I am using SQLAlchemy, I really desired to generate the FKs automatically, and this project was born.Installation: * download the zip package * unzip contents to somewhere on your python path o /usr/lib/python2.5/site-packages or o c:Python25Libsite-packages * you should end up with something like c:Python25Libsite-packagessqlitefktg4sa... Stability: * currently only tested on windows. If you have problems on non-windows system, feel free to put in a bug report and I will fix quickly. * Even though we are only at 0.1, the code is very simple and there is a small test suite covering the obvious use cases. Therefore, it should be pretty stable and any errors should be obvious up front. Example:Download the package and look in the tests directory for a full example. Its really simple to use:import * from sqlalchamyfrom sqlitefktg4sa import SqliteFkTriggerGenerator, auto_assign# define tables using Sqlalchemy...# set some tables manually to have FK generation happenmytable1.append_ddl_listener('after-create', SqliteFkTriggerGenerator)mytable2.append_ddl_listener('after-create', SqliteFkTriggerGenerator)# OR, assign it automatically for all tables in your metadataauto_assign(metadata)#create tables and triggersmetadata.create_all() Here are some key features of "SQLiteFKTG4SA": Currently supports: · insert · update · delete · delete cascade Requirements: · Python


SQLiteFKTG4SA Related Software