@@ -22,7 +22,7 @@ const NULL = NullType()
22
22
Base. show (io:: IO ,:: NullType ) = print (io," NULL" )
23
23
24
24
# internal wrapper type to, in-effect, mark something which has been serialized
25
- type Serialization
25
+ immutable Serialization
26
26
object
27
27
end
28
28
@@ -142,6 +142,8 @@ Base.bind(stmt::SQLiteStmt,i::Int,val::Int64) = @CHECK stmt.db sqlite3_
142
142
Base. bind (stmt:: SQLiteStmt ,i:: Int ,val:: NullType ) = @CHECK stmt. db sqlite3_bind_null (stmt. handle,i)
143
143
Base. bind (stmt:: SQLiteStmt ,i:: Int ,val:: AbstractString ) = @CHECK stmt. db sqlite3_bind_text (stmt. handle,i,val)
144
144
Base. bind (stmt:: SQLiteStmt ,i:: Int ,val:: UTF16String ) = @CHECK stmt. db sqlite3_bind_text16 (stmt. handle,i,val)
145
+ # We may want to track the new ByteVec type proposed at https://github.com/JuliaLang/julia/pull/8964
146
+ # as the "official" bytes type instead of Vector{UInt8}
145
147
Base. bind (stmt:: SQLiteStmt ,i:: Int ,val:: Vector{UInt8} ) = @CHECK stmt. db sqlite3_bind_blob (stmt. handle,i,val)
146
148
# Fallback is BLOB and defaults to serializing the julia value
147
149
function sqlserialize (x)
@@ -219,8 +221,8 @@ function query(db::SQLiteDB,sql::AbstractString, values=[])
219
221
elseif t == SQLITE_BLOB
220
222
blob = sqlite3_column_blob (stmt. handle,i- 1 )
221
223
b = sqlite3_column_bytes (stmt. handle,i- 1 )
222
- buf = zeros (Uint8 ,b)
223
- unsafe_copy! (pointer (buf), convert (Ptr{Uint8 },blob), b)
224
+ buf = zeros (UInt8 ,b)
225
+ unsafe_copy! (pointer (buf), convert (Ptr{UInt8 },blob), b)
224
226
r = sqldeserialize (buf)
225
227
else
226
228
r = NULL
0 commit comments