Throw invalid column count errors where the insert statement is executed
authorKarl O. Pinc <kop@karlpinc.com>
Sun, 23 Jun 2024 02:02:08 +0000 (21:02 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Sun, 23 Jun 2024 02:02:08 +0000 (21:02 -0500)
Psycopg 3 throws a generic ProgramimgError, so core.py has trouble
reporting the problem.  Perhaps this can be solved by creating a
generic PreparedStmt class at the core level, but this works for
the moment.

src/pgwui_upload/views/upload.py

index a6e2c5e743ff3d15c96f92efcf67cd88a0ca1632..e5cb7f4d4406b8057b0d8b796bf60b8ccf87bfd5 100644 (file)
@@ -45,6 +45,7 @@ from pgwui_core.core import (
 from pgwui_upload_core.views.upload import (
     UploadCoreInitialPost,
     BaseTableUploadHandler,
+    match_insert_to_dataline,
     set_upload_response,
 )
 
@@ -77,7 +78,8 @@ class SaveLine(DataLineProcessor, ParameterExecutor):
 
         udl  An UploadDataLine instance
         '''
-        self.param_execute(self.insert_stmt, udl)
+        match_insert_to_dataline(udl, self.insert_stmt)
+        self.param_execute(self.insert_stmt.stmt, udl)
 
 
 class TableUploadHandler(BaseTableUploadHandler):