(tablename,pkname,props)
return [key[0] for key in result]
根据所有的外键获取主键ID
根据所有的外键获取主键ID
根据所有的外键获取主键ID
def getAllPkByFkInDB(tablename,pkname,props):
    """根据所有的外键获取主键ID
    """
    props = FormatCondition(props)
    sql = """select `%s` from `%s` where %s;"""%(pkname,tablename,props)
    conn = dbpool.connection(write=False,tablename=tablename)
    cursor = conn.cursor()
    cursor.execute(sql)
    result = cursor.fetchall()
    cursor.close()
    conn.close()
    return [key[0] for key in result]
def getAllPkByFkInDB ( tablename , pkname , props ) : props = FormatCondition ( props ) sql = """select `%s` from `%s` where %s;""" % ( pkname , tablename , props ) conn = dbpool . connection ( write = False , tablename = tablename ) cursor = conn . cursor ( ) cursor . execute ( sql ) result = cursor . fetchall ( ) cursor . close ( ) conn . close ( ) return [ key [ 0 ] for key in result ]