File: Makefile

package info (click to toggle)
pgloader 3.6.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,040 kB
  • sloc: sql: 32,321; lisp: 14,792; makefile: 439; sh: 85; python: 26
file content (20 lines) | stat: -rw-r--r-- 510 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
DATASET = companies campaigns ads clicks impressions geo_ips
CSV     = $(addsuffix .csv,$(DATASET))
DROP = DROP TABLE IF EXISTS companies, campaigns, ads, clicks, impressions, geo_ips

all: schema data ;

schema:
	psql --single-transaction -c "$(DROP)" -d hackathon
	psql --single-transaction -f company.sql -d hackathon

data: fetch
	psql -f copy.sql -d hackathon
	../../build/bin/pgloader ./data.load

fetch: $(CSV) ;

%.csv:
	curl -O https://examples.citusdata.com/mt_ref_arch/$@

.PHONY: schema data fetch