Update SQL\PgSQL with param calls and heredoc, primary key search method update

The primary key currval select is udpated to use proper calls so it works with
serial and identity columns
This commit is contained in:
Clemens Schwaighofer
2024-11-22 17:25:22 +09:00
parent 87f35f23c3
commit 5454133239
2 changed files with 66 additions and 30 deletions

View File

@@ -160,15 +160,12 @@ final class CoreLibsDBIOTest extends TestCase
// create the tables
$db->dbExec(
// primary key name is table + '_id'
// table_with_primary_key_id SERIAL PRIMARY KEY,
<<<SQL
CREATE TABLE table_with_primary_key (
table_with_primary_key_id SERIAL PRIMARY KEY,
table_with_primary_key_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
$base_table
SQL
/* "CREATE TABLE table_with_primary_key ("
// primary key name is table + '_id'
. "table_with_primary_key_id SERIAL PRIMARY KEY, "
. $base_table */
);
$db->dbExec(
<<<SQL