Skip to content

Implementing SQL queries using decorators requires no additional logic besides SQL code.

License

Notifications You must be signed in to change notification settings

tomoncleshare/sql-annotation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sql-annotation

使用装饰器的方式来执行sql操作.

Install

  • pip: $ pip install sql-annotation
  • source:
    • $ git clone https://github.com/tomoncle/sql-annotation.git
    • $ cd sql-annotation
    • $ python setup.py

example:

from sql_annotation.annotation import select
from sql_annotation.conn import connection

connection(username='tom', password='123456', db='test')


@select('select * from t_school WHERE id="#{id}"')
def get_school_by_id(id):
    pass


@select('select * from t_school WHERE name like "%#{name}%"')
def get_school_by_name(name):
    pass


print get_school_by_id(id='60')
print get_school_by_name(name='乌克兰')

About

Implementing SQL queries using decorators requires no additional logic besides SQL code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages