-
Notifications
You must be signed in to change notification settings - Fork 49
/
LibPQ.jl
105 lines (79 loc) · 1.98 KB
/
LibPQ.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
module LibPQ
export status,
reset!,
execute,
prepare,
async_execute,
cancel,
num_columns,
num_rows,
num_params,
num_affected_rows
using Base: Semaphore, acquire, release
using Base.Iterators: zip, product
using Base.Threads
using Dates
using DocStringExtensions
using Decimals
using FileWatching
using Tables
using Infinity: InfExtendedTime, isposinf, ∞
using Intervals
using IterTools: imap
using LayerDicts
using Memento: Memento, getlogger, warn, info, error, debug
using OffsetArrays
using SQLStrings
using TimeZones
using UTCDateTimes
using DBInterface
const Parameter = Union{String,Missing}
const LOGGER = getlogger(@__MODULE__)
function __init__()
INTERVAL_REGEX[] = _interval_regex()
Memento.register(LOGGER)
return nothing
end
# Docstring template for types using DocStringExtensions
@template TYPES = """
$(TYPEDEF)
$(DOCSTRING)
## Fields:
$(TYPEDFIELDS)
"""
include(joinpath(@__DIR__, "utils.jl"))
module libpq_c
export Oid
using LibPQ_jll
include(joinpath(@__DIR__, "headers", "libpq-fe.jl"))
end
using .libpq_c
include("typemaps.jl")
const DEFAULT_CLIENT_TIME_ZONE = Ref("UTC")
"""
const LIBPQ_TYPE_MAP::PQTypeMap
The [`PQTypeMap`](@ref) containing LibPQ-level type mappings for LibPQ.jl.
Adding type mappings to this constant will override the default type mappings for all code
using LibPQ.jl.
"""
const LIBPQ_TYPE_MAP = PQTypeMap()
"""
const LIBPQ_CONVERSIONS::PQConversions
The [`PQConversions`](@ref) containing LibPQ-level conversion functions for LibPQ.jl.
Adding conversions to this constant will override the default conversions for all code using
LibPQ.jl.
"""
const LIBPQ_CONVERSIONS = PQConversions()
const BINARY = true
const TEXT = false
include("connections.jl")
include("results.jl")
include("statements.jl")
include("exceptions.jl")
include("parsing.jl")
include("copy.jl")
include("tables.jl")
include("dbinterface.jl")
include("asyncresults.jl")
include("deprecated.jl")
end