Created
August 21, 2025 23:01
-
-
Save mattwigway/735daff249bc6bc02bb50612bac95cf7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 is machine-generated - editing it directly is not advised | |
julia_version = "1.11.6" | |
manifest_format = "2.0" | |
project_hash = "ae50a05d7adfa8db4f604184627b97922c95f7ce" | |
[[deps.Artifacts]] | |
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" | |
version = "1.11.0" | |
[[deps.DBInterface]] | |
git-tree-sha1 = "a444404b3f94deaa43ca2a58e18153a82695282b" | |
uuid = "a10d1c49-ce27-4219-8d33-6db1a4562965" | |
version = "2.6.1" | |
[[deps.DataAPI]] | |
git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe" | |
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" | |
version = "1.16.0" | |
[[deps.DataValueInterfaces]] | |
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" | |
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" | |
version = "1.0.0" | |
[[deps.Dates]] | |
deps = ["Printf"] | |
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" | |
version = "1.11.0" | |
[[deps.InlineStrings]] | |
git-tree-sha1 = "8594fac023c5ce1ef78260f24d1ad18b4327b420" | |
uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" | |
version = "1.4.4" | |
[deps.InlineStrings.extensions] | |
ArrowTypesExt = "ArrowTypes" | |
ParsersExt = "Parsers" | |
[deps.InlineStrings.weakdeps] | |
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" | |
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" | |
[[deps.IteratorInterfaceExtensions]] | |
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" | |
uuid = "82899510-4779-5014-852e-03e436cf321d" | |
version = "1.0.0" | |
[[deps.JLLWrappers]] | |
deps = ["Artifacts", "Preferences"] | |
git-tree-sha1 = "0533e564aae234aff59ab625543145446d8b6ec2" | |
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" | |
version = "1.7.1" | |
[[deps.Libdl]] | |
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" | |
version = "1.11.0" | |
[[deps.OrderedCollections]] | |
git-tree-sha1 = "05868e21324cede2207c6f0f466b4bfef6d5e7ee" | |
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" | |
version = "1.8.1" | |
[[deps.Parsers]] | |
deps = ["Dates", "PrecompileTools", "UUIDs"] | |
git-tree-sha1 = "7d2f8f21da5db6a806faf7b9b292296da42b2810" | |
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" | |
version = "2.8.3" | |
[[deps.PrecompileTools]] | |
deps = ["Preferences"] | |
git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" | |
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" | |
version = "1.2.1" | |
[[deps.Preferences]] | |
deps = ["TOML"] | |
git-tree-sha1 = "0f27480397253da18fe2c12a4ba4eb9eb208bf3d" | |
uuid = "21216c6a-2e73-6563-6e65-726566657250" | |
version = "1.5.0" | |
[[deps.Printf]] | |
deps = ["Unicode"] | |
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" | |
version = "1.11.0" | |
[[deps.Random]] | |
deps = ["SHA"] | |
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | |
version = "1.11.0" | |
[[deps.SHA]] | |
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" | |
version = "0.7.0" | |
[[deps.SQLite]] | |
deps = ["DBInterface", "Random", "SQLite_jll", "Serialization", "Tables", "WeakRefStrings"] | |
git-tree-sha1 = "38b82dbc52b7db40bea182688c7a1103d06948a4" | |
uuid = "0aa819cd-b072-5ff4-a722-6bc24af294d9" | |
version = "1.6.1" | |
[[deps.SQLite_jll]] | |
deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] | |
git-tree-sha1 = "9a325057cdb9b066f1f96dc77218df60fe3007cb" | |
uuid = "76ed43ae-9a5d-5a62-8c75-30186b810ce8" | |
version = "3.48.0+0" | |
[[deps.Serialization]] | |
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" | |
version = "1.11.0" | |
[[deps.TOML]] | |
deps = ["Dates"] | |
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" | |
version = "1.0.3" | |
[[deps.TableTraits]] | |
deps = ["IteratorInterfaceExtensions"] | |
git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" | |
uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" | |
version = "1.0.1" | |
[[deps.Tables]] | |
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] | |
git-tree-sha1 = "f2c1efbc8f3a609aadf318094f8fc5204bdaf344" | |
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | |
version = "1.12.1" | |
[[deps.UUIDs]] | |
deps = ["Random", "SHA"] | |
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" | |
version = "1.11.0" | |
[[deps.Unicode]] | |
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" | |
version = "1.11.0" | |
[[deps.WeakRefStrings]] | |
deps = ["DataAPI", "InlineStrings", "Parsers"] | |
git-tree-sha1 = "b1be2855ed9ed8eac54e5caff2afcdb442d52c23" | |
uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5" | |
version = "1.4.2" | |
[[deps.Zlib_jll]] | |
deps = ["Libdl"] | |
uuid = "83775a58-1f1d-513f-b197-d71354ab007a" | |
version = "1.2.13+1" |
This file contains hidden or 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
[deps] | |
DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965" | |
SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9" |
This file contains hidden or 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
import SQLite, DBInterface | |
function showtable(cursor) | |
for row in cursor | |
println(collect(pairs(row))) | |
end | |
end | |
function main() | |
db1 = DBInterface.connect(SQLite.DB, "1.db") | |
db2 = DBInterface.connect(SQLite.DB, "2.db") | |
println("1.db:") | |
DBInterface.execute(showtable, db1, "SELECT * FROM test_table") | |
println("\n2.db:") | |
DBInterface.execute(showtable, db2, "SELECT * FROM test_table") | |
end | |
main() |
This file contains hidden or 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
import SQLite, DBInterface | |
function main() | |
db1 = DBInterface.connect(SQLite.DB, "1.db") | |
db2 = DBInterface.connect(SQLite.DB, "2.db") | |
DBInterface.execute(db1, "CREATE TABLE test_table (num INTEGER)") | |
DBInterface.execute(db2, "CREATE TABLE test_table (num INTEGER)") | |
# should insert into db1 | |
do_insert(db1, 1) | |
do_insert(db2, 2) | |
end | |
function do_insert(db, val) | |
# the prepared function is keyed on a unique symbol generated when the macro is executed. | |
# since the macro is only executed once, there is only one key. So the first time this gets | |
# called (to insert into db1) the statement is prepared. The second time the cached statement | |
# is used, which writes into DB1 even though DB2 was requested. | |
DBInterface.execute(identity, DBInterface.@prepare(() -> db, "INSERT INTO test_table (num) VALUES (?)"), (val,)) | |
end | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment