mirror of
https://github.com/actions/python-versions.git
synced 2025-04-07 15:59:40 +00:00
Build Python3 for nix and darwin with enabled loadable sqlite extensions
This commit is contained in:
19
tests/sources/python-sqlite3.py
Normal file
19
tests/sources/python-sqlite3.py
Normal file
@ -0,0 +1,19 @@
|
||||
import sqlite3
|
||||
from sqlite3 import Error
|
||||
|
||||
def create_connection(db_file):
|
||||
""" create a database connection to a SQLite database """
|
||||
conn = None
|
||||
try:
|
||||
print('Sqlite3 version: ', sqlite3.version)
|
||||
conn = sqlite3.connect(db_file)
|
||||
conn.enable_load_extension(True)
|
||||
except Error as e:
|
||||
print(e)
|
||||
exit(1)
|
||||
finally:
|
||||
if conn:
|
||||
conn.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
create_connection(r"pythonsqlite.db")
|
Reference in New Issue
Block a user