-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sql
43 lines (38 loc) · 881 Bytes
/
init.sql
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
CREATE TABLE ipaddr_v4 (
addr char(32),
prefixlen smallint,
cidr varchar(18),
country char(2)
);
.separator \t
.import '/tmp/cidr.txt' ipaddr_v4
CREATE TABLE ipaddr_v6 (
addr char(128),
prefixlen smallint,
cidr varchar(43),
country char(2)
);
.separator \t
.import '/tmp/cidr6.txt' ipaddr_v6
CREATE INDEX ipaddr_v4_idx1 ON ipaddr_v4(addr);
CREATE INDEX ipaddr_v6_idx1 ON ipaddr_v6(addr);
CREATE TABLE asn_v4 (
addr char(32),
prefixlen smallint,
cidr varchar(18),
asn int,
provider text
);
.separator \t
.import '/tmp/asn.csv' asn_v4
CREATE TABLE asn_v6 (
addr char(128),
prefixlen smallint,
cidr varchar(43),
asn int,
provider text
);
.separator \t
.import '/tmp/asn6.csv' asn_v6
CREATE INDEX asn_v4_idx1 ON asn_v4(addr);
CREATE INDEX asn_v6_idx1 ON asn_v6(addr);