Skip to content

Commit 1d7bdf4

Browse files
committed
lib/agency.js: adapt to DuckDB
1 parent b95f899 commit 1d7bdf4

File tree

3 files changed

+7
-33
lines changed

3 files changed

+7
-33
lines changed

lib/agency.js

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,10 @@ CREATE TABLE "${opt.schema}".agency (
1313
agency_phone TEXT,
1414
agency_fare_url TEXT,
1515
agency_email TEXT
16-
);
16+
)
17+
`)
1718

18-
COPY "${opt.schema}".agency (
19-
agency_id,
20-
agency_name,
21-
agency_url,
22-
agency_timezone,
23-
agency_lang,
24-
agency_phone,
25-
agency_fare_url,
26-
agency_email
27-
) FROM STDIN csv;
28-
`
29-
30-
const formatAgencyRow = (a) => {
31-
return [
32-
a.agency_id || null,
33-
a.agency_name || null,
34-
a.agency_url || null,
35-
a.agency_timezone || null,
36-
a.agency_lang || null,
37-
a.agency_phone || null,
38-
a.agency_fare_url || null,
39-
a.agency_email || null,
40-
]
19+
// todo
4120
}
4221

43-
const afterAll = `\
44-
\\.
45-
`
46-
47-
module.exports = {
48-
beforeAll,
49-
formatRow: formatAgencyRow,
50-
afterAll,
51-
}
22+
module.exports = importData

lib/deps.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
const getDependencies = (opt, files) => {
44
return {
5+
agency: [
6+
],
57
}
68
}
79

lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict'
22

33
module.exports = {
4+
agency: require('./agency'),
45
}

0 commit comments

Comments
 (0)