-
Notifications
You must be signed in to change notification settings - Fork 2
/
sql.py
105 lines (105 loc) · 4.15 KB
/
sql.py
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
create_LME_cotr_table_cmd = """
CREATE TABLE IF NOT EXISTS api_lme_cotr (
date DATE NOT NULL,
contract TEXT NOT NULL,
commercial_credit_long FLOAT NOT NULL,
commercial_credit_short FLOAT NOT NULL,
commercial_funds_long FLOAT NOT NULL,
commercial_funds_short FLOAT NOT NULL,
commercial_other_long FLOAT NOT NULL,
commercial_other_short FLOAT NOT NULL,
commercial_undertakings_long FLOAT NOT NULL,
commercial_undertakings_short FLOAT NOT NULL,
commercial_directive_long FLOAT NOT NULL,
commercial_directive_short FLOAT NOT NULL,
other_credit_long FLOAT NOT NULL,
other_credit_short FLOAT NOT NULL,
other_funds_long FLOAT NOT NULL,
other_funds_short FLOAT NOT NULL,
other_other_long FLOAT NOT NULL,
other_other_short FLOAT NOT NULL,
other_undertakings_long FLOAT NOT NULL,
other_undertakings_short FLOAT NOT NULL,
other_directive_long FLOAT NOT NULL,
other_directive_short FLOAT NOT NULL,
tot_credit_long FLOAT NOT NULL,
tot_credit_short FLOAT NOT NULL,
tot_funds_long FLOAT NOT NULL,
tot_funds_short FLOAT NOT NULL,
tot_other_long FLOAT NOT NULL,
tot_other_short FLOAT NOT NULL,
tot_undertakings_long FLOAT NOT NULL,
tot_undertakings_short FLOAT NOT NULL,
tot_directive_long FLOAT NOT NULL,
tot_directive_short FLOAT NOT NULL,
change_commercial_credit_long FLOAT,
change_commercial_credit_short FLOAT,
change_commercial_funds_long FLOAT,
change_commercial_funds_short FLOAT,
change_commercial_other_long FLOAT,
change_commercial_other_short FLOAT,
change_commercial_undertakings_long FLOAT,
change_commercial_undertakings_short FLOAT,
change_commercial_directive_long FLOAT,
change_commercial_directive_short FLOAT,
change_other_credit_long FLOAT,
change_other_credit_short FLOAT,
change_other_funds_long FLOAT,
change_other_funds_short FLOAT,
change_other_other_long FLOAT,
change_other_other_short FLOAT,
change_other_undertakings_long FLOAT,
change_other_undertakings_short FLOAT,
change_other_directive_long FLOAT,
change_other_directive_short FLOAT,
change_tot_credit_long FLOAT,
change_tot_credit_short FLOAT,
change_tot_funds_long FLOAT,
change_tot_funds_short FLOAT,
change_tot_other_long FLOAT,
change_tot_other_short FLOAT,
change_tot_undertakings_long FLOAT,
change_tot_undertakings_short FLOAT,
change_tot_directive_long FLOAT,
change_tot_directive_short FLOAT,
pct_commercial_credit_long FLOAT NOT NULL,
pct_commercial_credit_short FLOAT NOT NULL,
pct_commercial_funds_long FLOAT NOT NULL,
pct_commercial_funds_short FLOAT NOT NULL,
pct_commercial_other_long FLOAT NOT NULL,
pct_commercial_other_short FLOAT NOT NULL,
pct_commercial_undertakings_long FLOAT NOT NULL,
pct_commercial_undertakings_short FLOAT NOT NULL,
pct_commercial_directive_long FLOAT NOT NULL,
pct_commercial_directive_short FLOAT NOT NULL,
pct_other_credit_long FLOAT NOT NULL,
pct_other_credit_short FLOAT NOT NULL,
pct_other_funds_long FLOAT NOT NULL,
pct_other_funds_short FLOAT NOT NULL,
pct_other_other_long FLOAT NOT NULL,
pct_other_other_short FLOAT NOT NULL,
pct_other_undertakings_long FLOAT NOT NULL,
pct_other_undertakings_short FLOAT NOT NULL,
pct_other_directive_long FLOAT NOT NULL,
pct_other_directive_short FLOAT NOT NULL,
pct_tot_credit_long FLOAT NOT NULL,
pct_tot_credit_short FLOAT NOT NULL,
pct_tot_funds_long FLOAT NOT NULL,
pct_tot_funds_short FLOAT NOT NULL,
pct_tot_other_long FLOAT NOT NULL,
pct_tot_other_short FLOAT NOT NULL,
pct_tot_undertakings_long FLOAT NOT NULL,
pct_tot_undertakings_short FLOAT NOT NULL,
pct_tot_directive_long FLOAT NOT NULL,
pct_tot_directive_short FLOAT NOT NULL,
traders_credit TEXT NOT NULL,
traders_funds TEXT NOT NULL,
traders_other TEXT NOT NULL,
traders_undertakings TEXT NOT NULL,
traders_directive TEXT NOT NULL,
traders_tot_credit BIGINT,
traders_tot_funds BIGINT,
traders_tot_other BIGINT,
traders_tot_undertakings BIGINT,
traders_tot_directive BIGINT,
PRIMARY KEY (date, contract));"""