-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade irodsfs/irodsfs-pool to support embedded db
- Loading branch information
Showing
9 changed files
with
61 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import duckdb | ||
|
||
print("creating a DuckDB DB file - 'test_duckdb.db'") | ||
conn = duckdb.connect("test_duckdb.db") | ||
|
||
print("creating a table") | ||
conn.sql("CREATE TABLE movie(title VARCHAR, year INTEGER, score DOUBLE)") | ||
|
||
print("inserting records to the table") | ||
data = [ | ||
("Monty Python Live at the Hollywood Bowl", 1982, 7.9), | ||
("Monty Python The Meaning of Life", 1983, 7.5), | ||
("Monty Python Life of Brian", 1979, 8.0), | ||
] | ||
for d in data: | ||
conn.execute("INSERT INTO movie VALUES('%s', %d, %f)" % d) | ||
|
||
print("retrieving records from the table") | ||
conn.execute("SELECT * FROM movie") | ||
for row in conn.fetchall(): | ||
print(row) | ||
|
||
print("done!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import sqlite3 | ||
|
||
print("creating a SQLite DB file - 'test_sqlite.db'") | ||
conn = sqlite3.connect("test_sqlite.db") | ||
cur = conn.cursor() | ||
|
||
print("creating a table") | ||
cur.execute("CREATE TABLE movie(title, year, score)") | ||
|
||
print("inserting records to the table") | ||
data = [ | ||
("Monty Python Live at the Hollywood Bowl", 1982, 7.9), | ||
("Monty Python's The Meaning of Life", 1983, 7.5), | ||
("Monty Python's Life of Brian", 1979, 8.0), | ||
] | ||
cur.executemany("INSERT INTO movie VALUES(?, ?, ?)", data) | ||
conn.commit() | ||
|
||
print("retrieving records from the table") | ||
for row in cur.execute("SELECT year, title FROM movie ORDER BY year"): | ||
print(row) | ||
|
||
print("done!") |