Update sqlite3-python/README.md
This commit is contained in:
@@ -2,9 +2,10 @@
|
|||||||
```python
|
```python
|
||||||
def SQL(db='sql.db', *, sqlite3=__import__('sqlite3'), pd=__import__('pandas')):
|
def SQL(db='sql.db', *, sqlite3=__import__('sqlite3'), pd=__import__('pandas')):
|
||||||
con = sqlite3.connect(db, isolation_level=None, timeout=1e999)
|
con = sqlite3.connect(db, isolation_level=None, timeout=1e999)
|
||||||
con.execute('PRAGMA journal_mode=WAL')
|
con.execute('PRAGMA journal_mode=WAL'); con.row_factory = sqlite3.Row
|
||||||
return lambda q, *p: pd.read_sql_query(q, con, params=p)
|
return lambda sql, *params: pd.DataFrame(map(dict, con.execute(sql, params)))
|
||||||
sql = SQL()
|
sql = SQL()
|
||||||
|
sql('SELECT * FROM sqlite_master WHERE type="table"')
|
||||||
```
|
```
|
||||||
|
|
||||||
# Simple
|
# Simple
|
||||||
|
|||||||
Reference in New Issue
Block a user