Last active
April 24, 2018 14:11
-
-
Save pypeach/df3c3d93d8f216ca23e33b423dd60622 to your computer and use it in GitHub Desktop.
共通SQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
メソッド名を変更
command_execute→ddl_execute