@@ -9,30 +9,7 @@ abstract AbstractOID
9
9
type OID{N} <: AbstractOID end
10
10
11
11
oid {T<:AbstractPostgresType} (t:: Type{T} ) = convert (OID, t)
12
-
13
- if VERSION < v " 0.5-dev+4194"
14
- import Compat
15
-
16
- function pgtype (t:: Type )
17
- if t <: Compat.ASCIIString
18
- convert (PostgresType, String)
19
- elseif t <: Vector{Compat.ASCIIString}
20
- convert (PostgresType, Vector{String})
21
- else
22
- convert (PostgresType, t)
23
- end
24
- end
25
-
26
- function pgdata (:: Type{PostgresType{:_varchar}} , ptr:: Ptr{UInt8} , data:: Vector{Compat.ASCIIString} )
27
- ptr = storestring! (ptr, string (" {" , join (data, ' ,' ), " }" ))
28
- end
29
-
30
- function pgdata (:: Type{PostgresType{:_text}} , ptr:: Ptr{UInt8} , data:: Vector{Compat.ASCIIString} )
31
- ptr = storestring! (ptr, string (" {" , join (data, ' ,' ), " }" ))
32
- end
33
- else
34
- pgtype (t:: Type ) = convert (PostgresType, t)
35
- end
12
+ pgtype (t:: Type ) = convert (PostgresType, t)
36
13
37
14
Base. convert {T} (:: Type{Oid} , :: Type{OID{T}} ) = convert (Oid, T)
38
15
@@ -289,3 +266,17 @@ function Base.copy(rh::PostgresResultHandle)
289
266
PG_COPYRES_NOTICEHOOKS | PG_COPYRES_EVENTS), copy (rh. types), rh. ntuples, rh. nfields)
290
267
end
291
268
269
+ if VERSION < v " 0.5-dev+4194"
270
+ import Compat
271
+
272
+ pgtype {T<:Compat.ASCIIString} (:: Type{T} ) = convert (PostgresType, String)
273
+ pgtype {T<:Vector{Compat.ASCIIString}} (:: Type{T} ) = convert (PostgresType, Vector{String})
274
+
275
+ function pgdata (:: Type{PostgresType{:_varchar}} , ptr:: Ptr{UInt8} , data:: Vector{Compat.ASCIIString} )
276
+ ptr = storestring! (ptr, string (" {" , join (data, ' ,' ), " }" ))
277
+ end
278
+
279
+ function pgdata (:: Type{PostgresType{:_text}} , ptr:: Ptr{UInt8} , data:: Vector{Compat.ASCIIString} )
280
+ ptr = storestring! (ptr, string (" {" , join (data, ' ,' ), " }" ))
281
+ end
282
+ end
0 commit comments