diff --git a/.github/workflows/input-postgresql.yml b/.github/workflows/input-postgresql.yml index a842512..b70ee46 100644 --- a/.github/workflows/input-postgresql.yml +++ b/.github/workflows/input-postgresql.yml @@ -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 diff --git a/input-postgresql/create-table.sql b/input-postgresql/create-table.sql new file mode 100644 index 0000000..9d8ff36 --- /dev/null +++ b/input-postgresql/create-table.sql @@ -0,0 +1,4 @@ +CREATE TABLE test ( + id integer, + name text +); diff --git a/input-postgresql/insert-data.sql b/input-postgresql/insert-data.sql new file mode 100644 index 0000000..f89b1ba --- /dev/null +++ b/input-postgresql/insert-data.sql @@ -0,0 +1,7 @@ +INSERT INTO test (id, name) VALUES + (1, 'Alpha'), + (2, 'Bravo'), + (3, 'Charlie'), + (4, 'Delta'), + (5, 'Echo'), + (6, 'Foxtrot');