Skip to content

justinfay/flask-dbkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-DBKit

Simple dbkit integration for Flask.

Overview

Flask-DBKit aims to provide painless integration of dbkit for the Flask web framework.

Features

  • Wraps each call to the flask wsgi applicaton with a dbkit execution context.
  • Simplify database configuration values for different database engines.

Quickstart

A simple example of how to initialise the extension:

from dbkit import query_value
from flask import Flask
from flask.ext.dbkit import DBKit
import sqlite3

app = Flask(__name__)
app.config['DB_DATABASE'] = ':memory:'

dbkit = DBKit(sqlite3)
dbkit.init_app(app)

@app.route('/')
def index():
    return query_value('SELECT "Hi there from your DB."')

if __name__ == "__main__":
    app.run()

Limitations

  • Currently limits the pool implementation to that as returned by dbkit.create_pool.
  • Causes a pool connection on every application endpoint regardless of whether it actually uses it.

About

dbkit integration for Flask.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages