GithubHelp home page GithubHelp logo

greengremlin / flask-dbshell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ffeast/flask-dbshell

0.0 1.0 0.0 7 KB

The extension provides facilites for implementing Django-like "./manage.py dbshell" command

Python 100.00%

flask-dbshell's Introduction

Flask DbShell

The extension provides facilites for implementing Django-like ./manage.py dbshell command

Installation

Install the extension with one of the following commands:

$ easy_install flask-dbshell

or alternatively if you have pip installed:

$ pip install flask-dbshell

How to use

Example of a simple script that runs mysql's shell

from flask.ext.dbshell import DbShell


def main():
    dbshell = DbShell('mysql://scott:tiger@server/dbname')
    dbshell.run_shell()
    

if __name__ == '__main__':
    main()

Example of use with Flask-Script:

from flask import Flask
from flask.ext.script import Manager
from flask.ext.dbshell import DbShell


class DevConfig(object):
    DATABASE_URI = 'sqlite:///demo.sqlite'


app = Flask(__name__)
app.config.from_object(DevConfig)
manager = Manager(app)


@manager.command
def dbshell():
    shell = DbShell(url=app.config['DATABASE_URI'])
    shell.run_shell()


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

Python versions supported

Tested with 2.6.x and 2.7.x

flask-dbshell's People

Contributors

ffeast avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.