Skip to content

Instantly share code, notes, and snippets.

@pypeach
Last active April 24, 2018 14:11
Show Gist options
  • Save pypeach/df3c3d93d8f216ca23e33b423dd60622 to your computer and use it in GitHub Desktop.
Save pypeach/df3c3d93d8f216ca23e33b423dd60622 to your computer and use it in GitHub Desktop.
共通SQL
# coding:utf-8
from util import db
"""
テーブル指定の共通的なSQLコマンドを実行する
"""
__author__ = "t.ebinuma"
__version__ = "1.1"
__date__ = "11 February 2018"
def delete_all(table):
"""
全レコードを削除する
(SQLiteはTRUNCATE TABLEがないためです)
"""
return db.dml_execute('delete from ' + table)
def drop_table(table):
"""
DROP TABLEを行う
"""
return db.ddl_execute('drop table if exists ' + table)
@pypeach
Copy link
Author

pypeach commented Apr 23, 2018

メソッド名を変更
command_execute→ddl_execute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment