Skip to content

Commit 5e8dd3d

Browse files
authored
Merge branch 'JuliaDatabases:master' into master
2 parents 9873efe + ccdb8b0 commit 5e8dd3d

File tree

8 files changed

+50
-102
lines changed

8 files changed

+50
-102
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SQLite"
22
uuid = "0aa819cd-b072-5ff4-a722-6bc24af294d9"
33
authors = ["Jacob Quinn <[email protected]>", "JuliaData Contributors"]
4-
version = "1.6.0"
4+
version = "1.6.1"
55

66
[deps]
77
DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965"

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Manifest.toml

docs/Manifest.toml

Lines changed: 0 additions & 93 deletions
This file was deleted.

docs/Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
2+
DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965"
23
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
34
SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9"
45

56
[compat]
6-
Documenter = "~0.26.1"
7+
Documenter = "1.3"

docs/make.jl

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
using Documenter, SQLite
1+
import Pkg
2+
3+
cd(@__DIR__)
4+
Pkg.activate(@__DIR__)
5+
Pkg.develop(path="..")
6+
Pkg.instantiate()
7+
8+
using Documenter, SQLite, DBInterface
9+
10+
DocMeta.setdocmeta!(SQLite, :DocTestSetup, :(using SQLite, DBInterface); recursive=true)
211

312
makedocs(;
4-
modules = [SQLite],
5-
format = Documenter.HTML(),
13+
format = Documenter.HTML(
14+
prettyurls = get(ENV, "CI", nothing) == true,
15+
),
616
pages = ["Home" => "index.md"],
7-
repo = "https://github.com/JuliaDatabases/SQLite.jl/blob/{commit}{path}#L{line}",
17+
repo = Remotes.GitHub("JuliaDatabases", "SQLite.jl"),
818
sitename = "SQLite.jl",
919
authors = "Jacob Quinn",
10-
assets = String[],
1120
)
1221

13-
deploydocs(; repo = "github.com/JuliaDatabases/SQLite.jl")
22+
deploydocs(
23+
repo = "https://www.github.com/JuliaDatabases/SQLite.jl.git",
24+
)

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
## High-level interface
77
```@docs
8-
DBInterface.execute
8+
DBInterface.execute(::SQLite.Stmt, ::DBInterface.StatementParams)
99
SQLite.load!
1010
```
1111

src/SQLite.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,16 @@ function bind!(stmt::Stmt, i::Integer, val::Vector{UInt8})
359359
C.SQLITE_STATIC,
360360
)
361361
end
362+
function bind!(stmt::Stmt, i::Integer, val::Base.ReinterpretArray{UInt8, 1, T, <:DenseVector{T}, false}) where T
363+
stmt.params[i] = val
364+
@CHECK stmt.db C.sqlite3_bind_blob(
365+
_get_stmt_handle(stmt),
366+
i,
367+
Ref(val, 1),
368+
sizeof(eltype(val)) * length(val),
369+
C.SQLITE_STATIC,
370+
)
371+
end
362372
# Fallback is BLOB and defaults to serializing the julia value
363373

364374
# internal wrapper mutable struct to, in-effect, mark something which has been serialized

test/runtests.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,24 @@ end
906906
close(db)
907907
rm(dbfile)
908908
end
909+
910+
@testset "ReinterpretArray" begin
911+
binddb = SQLite.DB()
912+
DBInterface.execute(
913+
binddb,
914+
"CREATE TABLE temp (b BLOB)",
915+
)
916+
DBInterface.execute(
917+
binddb,
918+
"INSERT INTO temp VALUES (?)",
919+
[reinterpret(UInt8, [0x6f46, 0x426f, 0x7261]),],
920+
)
921+
rr = DBInterface.execute(rowtable, binddb, "SELECT b FROM temp")
922+
@test length(rr) == 1
923+
r = first(rr)
924+
@test r.b == codeunits("FooBar")
925+
@test typeof.(Tuple(r)) == (Vector{UInt8},)
926+
end
909927
end # @testset
910928

911929
struct UnknownSchemaTable end

0 commit comments

Comments
 (0)