From b0fcfd3d5d1869074d9d1572e6b362ac417d5fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Tue, 28 May 2024 13:04:37 +0200 Subject: [PATCH] chore: add echo messages to psql scripts --- samples/snippets/psql-snippets/add_column.sh | 1 + samples/snippets/psql-snippets/create_tables.sh | 2 ++ samples/snippets/psql-snippets/ddl_batch.sh | 2 ++ samples/snippets/psql-snippets/partitioned_dml.sh | 2 ++ samples/snippets/psql-snippets/tags.sh | 2 ++ samples/snippets/psql-snippets/update_data_with_copy.sh | 2 ++ samples/snippets/psql-snippets/update_data_with_transaction.sh | 2 ++ samples/snippets/psql-snippets/write_data_with_copy.sh | 2 ++ samples/snippets/psql-snippets/write_data_with_dml.sh | 2 ++ samples/snippets/psql-snippets/write_data_with_dml_batch.sh | 2 ++ 10 files changed, 19 insertions(+) diff --git a/samples/snippets/psql-snippets/add_column.sh b/samples/snippets/psql-snippets/add_column.sh index acfff9e10..2e3966c13 100755 --- a/samples/snippets/psql-snippets/add_column.sh +++ b/samples/snippets/psql-snippets/add_column.sh @@ -5,3 +5,4 @@ export PGPORT="${PGPORT:-5432}" export PGDATABASE="${PGDATABASE:-example-db}" psql -c "ALTER TABLE albums ADD COLUMN marketing_budget bigint" +echo "Added marketing_budget column" diff --git a/samples/snippets/psql-snippets/create_tables.sh b/samples/snippets/psql-snippets/create_tables.sh index e60ac6b56..461473bb0 100755 --- a/samples/snippets/psql-snippets/create_tables.sh +++ b/samples/snippets/psql-snippets/create_tables.sh @@ -31,3 +31,5 @@ CREATE TABLE albums ( -- open-source PostgreSQL. INTERLEAVE IN PARENT singers ON DELETE CASCADE; SQL + +echo "Created Singers & Albums tables in database: [${PGDATABASE}]" diff --git a/samples/snippets/psql-snippets/ddl_batch.sh b/samples/snippets/psql-snippets/ddl_batch.sh index 519718086..865cf6c8e 100755 --- a/samples/snippets/psql-snippets/ddl_batch.sh +++ b/samples/snippets/psql-snippets/ddl_batch.sh @@ -29,3 +29,5 @@ CREATE TABLE concerts ( ); SQL + +echo "Added venues and concerts tables" diff --git a/samples/snippets/psql-snippets/partitioned_dml.sh b/samples/snippets/psql-snippets/partitioned_dml.sh index 6e3ebc056..8d0881625 100755 --- a/samples/snippets/psql-snippets/partitioned_dml.sh +++ b/samples/snippets/psql-snippets/partitioned_dml.sh @@ -12,3 +12,5 @@ psql -c "set spanner.autocommit_dml_mode='partitioned_non_atomic'" \ -c "update albums set marketing_budget=0 where marketing_budget is null" + +echo "Updated albums using Partitioned DML" diff --git a/samples/snippets/psql-snippets/tags.sh b/samples/snippets/psql-snippets/tags.sh index f97b4fea7..ed402624c 100755 --- a/samples/snippets/psql-snippets/tags.sh +++ b/samples/snippets/psql-snippets/tags.sh @@ -33,3 +33,5 @@ psql << SQL commit; SQL + +echo "Reduced marketing budget" diff --git a/samples/snippets/psql-snippets/update_data_with_copy.sh b/samples/snippets/psql-snippets/update_data_with_copy.sh index 7455b78db..96d3e4c43 100755 --- a/samples/snippets/psql-snippets/update_data_with_copy.sh +++ b/samples/snippets/psql-snippets/update_data_with_copy.sh @@ -13,3 +13,5 @@ psql -c "set spanner.copy_upsert=true" \ 1;1;100000 2;2;500000 DATA + +echo "Copied albums using upsert" diff --git a/samples/snippets/psql-snippets/update_data_with_transaction.sh b/samples/snippets/psql-snippets/update_data_with_transaction.sh index 2fb040e9d..af8c82163 100755 --- a/samples/snippets/psql-snippets/update_data_with_transaction.sh +++ b/samples/snippets/psql-snippets/update_data_with_transaction.sh @@ -37,3 +37,5 @@ psql << SQL -- durably stored in the database and visible to other transactions. commit; SQL + +echo "Transferred marketing budget from Album 2 to Album 1" diff --git a/samples/snippets/psql-snippets/write_data_with_copy.sh b/samples/snippets/psql-snippets/write_data_with_copy.sh index 730277b1a..5122ee858 100755 --- a/samples/snippets/psql-snippets/write_data_with_copy.sh +++ b/samples/snippets/psql-snippets/write_data_with_copy.sh @@ -12,3 +12,5 @@ psql -c "COPY singers (singer_id, first_name, last_name) FROM STDIN" \ < "${directory}singers_data.txt" psql -c "COPY albums FROM STDIN" \ < "${directory}albums_data.txt" + +echo "Copied singers and albums" diff --git a/samples/snippets/psql-snippets/write_data_with_dml.sh b/samples/snippets/psql-snippets/write_data_with_dml.sh index 38e6a4350..2bc9914f1 100755 --- a/samples/snippets/psql-snippets/write_data_with_dml.sh +++ b/samples/snippets/psql-snippets/write_data_with_dml.sh @@ -9,3 +9,5 @@ psql -c "INSERT INTO singers (singer_id, first_name, last_name) VALUES (13, 'Russel', 'Morales'), (14, 'Jacqueline', 'Long'), (15, 'Dylan', 'Shaw')" + +echo "4 records inserted" diff --git a/samples/snippets/psql-snippets/write_data_with_dml_batch.sh b/samples/snippets/psql-snippets/write_data_with_dml_batch.sh index 2c44f17c7..76f8d624a 100755 --- a/samples/snippets/psql-snippets/write_data_with_dml_batch.sh +++ b/samples/snippets/psql-snippets/write_data_with_dml_batch.sh @@ -14,3 +14,5 @@ psql -c "PREPARE insert_singer AS -c "EXECUTE insert_singer (16, 'Sarah', 'Wilson'); EXECUTE insert_singer (17, 'Ethan', 'Miller'); EXECUTE insert_singer (18, 'Maya', 'Patel');" + +echo "3 records inserted"