Add feature to upload missing column values as NULL
authorKarl O. Pinc <kop@karlpinc.com>
Thu, 10 Oct 2024 18:26:23 +0000 (13:26 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Thu, 10 Oct 2024 18:26:23 +0000 (13:26 -0500)
examples/etc/pgwui.yaml
examples/misc/development.yaml

index 0712b333ff93892f14e3093b25c54424ffb473a2..21457507bcac477d03b224d48f134c5276093a53 100644 (file)
@@ -247,6 +247,7 @@ app:
     #  trim: 'choice-yes'
     #  null: 'choice-yes'
     #  file_format: 'csv'
+    #  add_missing_columns: 'no-never'
     #
     # literal_column_headings
     # Take uploaded column headings literally?
@@ -288,6 +289,17 @@ app:
     # The available choices are:
     #   csv           The CSV format. (default)
     #   tab           Tab separated values.
+    #
+    # add_missing_columns
+    # Add columns instead of reporting an error when a uploaded row has
+    # fewer columns than are present in the column headings given in the
+    # first row.  The added values are presented to Postgres as NULL values.
+    # The available choices are:
+    #   yes-always    Always add missing column values.
+    #   choice-yes    Present a checkbox, default to "yes".
+    #   choice-no     Present a checkbox, default to "no".
+    #   no-never      Always report an error when a row has too few columns.
+    # Optional setting.  The default is "no-never".
 
 
     # pgwui_bulk_upload
@@ -299,6 +311,7 @@ app:
     #   trim: 'choice-yes'
     #   null: 'choice-yes'
     #   file_format: 'csv'
+    #   add_missing_columns: 'no-never'
     #
     # literal_column_headings: 'no-never' (default)
     #   Take uploaded column headings literally?
@@ -356,6 +369,10 @@ app:
     # file_format: 'csv' (default)
     #   The format of the uploaded files.
     #   See pgwui_upload above for details.
+    #
+    # add_missing_columns: 'no-never' (default)
+    #   Add columns when rows are too short.
+    #   See pgwui_upload above for details.
 
 
     # pgwui_upcen
index 38b6971bfed85f4e27821eb37d04f8271bef9dd2..ab5e21e7dfaada4183dcacbe0f9f900f75df43e3 100644 (file)
@@ -240,12 +240,13 @@ app:
     # pgwui_upload
 
     # The default pgwui_upload settings are:
-    #pgwui_upload:
-    #  literal_column_headings: 'no-never'
-    #  menu_label: 'upload -- Upload File Into Database'
-    #  trim: 'choice-yes'
-    #  null: 'choice-yes'
-    #  file_format: 'csv'
+    # pgwui_upload:
+    #   literal_column_headings: 'no-never'
+    #   menu_label: 'upload -- Upload File Into Database'
+    #   trim: 'choice-yes'
+    #   null: 'choice-yes'
+    #   file_format: 'csv'
+    #   add_missing_columns: 'no-never'
     #
     # literal_column_headings
     # Take uploaded column headings literally?
@@ -287,6 +288,17 @@ app:
     # The available choices are:
     #   csv           The CSV format.
     #   tab           Tab separated values.
+    #
+    # add_missing_columns
+    # Add columns instead of reporting an error when a uploaded row has
+    # fewer columns than are present in the column headings given in the
+    # first row.  The added values are presented to Postgres as NULL values.
+    # The available choices are:
+    #   yes-always    Always add missing column values.
+    #   choice-yes    Present a checkbox, default to "yes".
+    #   choice-no     Present a checkbox, default to "no".
+    #   no-never      Always report an error when a row has too few columns.
+    # Optional setting.  The default is "no-never".
 
 
     # pgwui_bulk_upload
@@ -298,6 +310,7 @@ app:
     #   trim: 'choice-yes'
     #   null: 'choice-yes'
     #   file_format: 'csv'
+    #   add_missing_columns: 'no-never'
     #
     # literal_column_headings: 'no-never'
     #   Take uploaded column headings literally?
@@ -355,6 +368,10 @@ app:
     # file_format: 'csv'
     #   The format of the uploaded files.
     #   See pgwui_upload above for details.
+    #
+    # add_missing_columns: 'no-never' (default)
+    #   Add columns when rows are too short.
+    #   See pgwui_upload above for details.
 
 
     # pgwui_upcen