Update csv handling
This commit is contained in:
@ -8,7 +8,7 @@ import os
|
||||
import re
|
||||
import datetime
|
||||
|
||||
import csv
|
||||
import utils
|
||||
|
||||
|
||||
DIR: str
|
||||
@ -46,7 +46,7 @@ def sqlite_regexp(pattern: str, value: Optional[str]) -> Optional[bool]:
|
||||
|
||||
|
||||
def import_csv(cur: sqlite3.Cursor, table_name: str) -> None:
|
||||
rows = csv.parse(f'{DIR}/{table_name}.csv')
|
||||
rows = utils.csv_parse(f'{DIR}/{table_name}.csv')
|
||||
names = next(rows)
|
||||
|
||||
sql = f'INSERT INTO {table_name} ({", ".join(names)}) VALUES ({", ".join(["?"] * len(names))})'
|
||||
|
Reference in New Issue
Block a user