import sqlite3
from sqlite3 import Cursor, Error
def sql_set(query = None,data = None):
    if query == None: return
    try:
        con = sqlite3.connect('sbsheriff.sqlite')
        cur = con.cursor()
        cur.execute(query,data)
        cur.close()
        con.commit()
        con.close()

    except Error as e:
        print(e)
        return Error

def sql_get(query = None):
    if query == None: return
    try:
        con = sqlite3.connect('sbsheriff.sqlite')
        cur = con.cursor()
        cur.execute(query)
        re = cur.fetchall()
        cur.close()
        con.close()
        return re

    except Error as e:
        print(e)
        return Error
