Update REGEXP function for sqlite
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import annotations
|
||||
from typing import Iterator, Dict, Any, Tuple, TextIO, List
|
||||
from typing import Iterator, Dict, Any, Tuple, TextIO, List, Optional
|
||||
import re
|
||||
import datetime
|
||||
import csv
|
||||
@ -13,6 +13,10 @@ RE_STR_START = re.compile(r'.*,"[^"]*$')
|
||||
RE_STR_END = re.compile(r'^[^"]*",.*')
|
||||
|
||||
|
||||
def sqlite_regexp(pattern: str, value: Optional[str]) -> Optional[bool]:
|
||||
return re.match(pattern, value) is not None if value is not None else None
|
||||
|
||||
|
||||
def cast_value(value: str) -> Any:
|
||||
if value == '':
|
||||
return None
|
||||
|
Reference in New Issue
Block a user