Skip to content

Commit

Permalink
Create a table and insert data
Browse files Browse the repository at this point in the history
  • Loading branch information
dmikurube committed Sep 25, 2024
1 parent 00d2a0f commit eff9661
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/input-postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@ jobs:
- name: List files under the Embulk home directory
run: ls -laR "$HOME/.embulk/"

- name: Access PostgreSQL
run: psql -h localhost -U postgres -d postgres -c "\l"
- name: Create a table in PostgreSQL
run: psql -h localhost -U postgres -d postgres -f "input-postgresql/create-table.sql"
env:
PGPASSWORD: postgres

- name: Insert data in PostgreSQL
run: psql -h localhost -U postgres -d postgres -f "input-postgresql/insert-data.sql"
env:
PGPASSWORD: postgres

- name: Show data in PostgreSQL
run: psql -h localhost -U postgres -d postgres -c "select * from test;"
env:
PGPASSWORD: postgres
4 changes: 4 additions & 0 deletions input-postgresql/create-table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE TABLE test (
id integer,
name text
);
7 changes: 7 additions & 0 deletions input-postgresql/insert-data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
INSERT INTO test (id, name) VALUES
(1, 'Alpha'),
(2, 'Bravo'),
(3, 'Charlie'),
(4, 'Delta'),
(5, 'Echo'),
(6, 'Foxtrot');

0 comments on commit eff9661

Please sign in to comment.