Composer test update

This commit is contained in:
Clemens Schwaighofer
2023-04-03 15:05:22 +09:00
parent 75a42558fd
commit 516b11f2f1
7 changed files with 37 additions and 12 deletions

View File

@@ -413,13 +413,35 @@ if (is_array($s_res = $db->dbReturnRow($q)) && !empty($s_res['test'])) {
}
// UPDATE WITH RETURNING
$status = $db->dbExec("UPDATE test_foo SET test = 'SOMETHING DIFFERENT' "
. "WHERE test_foo_id = " . (int)$last_insert_pk . " RETURNING test");
$status = $db->dbExec("UPDATE test_foo SET test = 'SOMETHING DIFFERENT', string_a = '" . (string)rand(1, 100) . "' "
. "WHERE test_foo_id = " . (int)$last_insert_pk . " RETURNING test_foo.test, string_a");
print "UPDATE WITH PK " . Support::printToString($last_insert_pk)
. " RETURN STATUS: " . Support::printToString($status) . " |<br>"
. "QUERY: " . $db->dbGetQuery() . " |<br>"
. "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | "
. "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>";
// UPDATE BUT EOM STYLE
$status = $db->dbExecParams(
<<<EOM
UPDATE
test_foo
SET
test = ?,
string_a = ?
WHERE
tset_foo_id = ?
RETURNING
test_foo.test, string_a
EOM,
['SOMETHING DIFFERENT EOM', (string)rand(1, 100)]
);
print "UPDATE EOM WITH PK " . Support::printToString($last_insert_pk)
. " RETURN STATUS: " . Support::printToString($status) . " |<br>"
. "QUERY: " . $db->dbGetQuery() . " |<br>"
. "RETURNING EXT: " . print_r($db->dbGetReturningExt(), true) . " | "
. "RETURNING ARRAY: " . print_r($db->dbGetReturningArray(), true) . "<br>";
// a stand alone insert?
$db->dbExec("INSERT INTO test_foo (test) VALUES ('STAND ALONE')");
// INSERT WITH NO RETURNING

4
www/composer.lock generated
View File

@@ -8,11 +8,11 @@
"packages": [
{
"name": "egrajp/corelibs-composer-all",
"version": "dev-development",
"version": "dev-master",
"dist": {
"type": "path",
"url": "/storage/var/www/html/developers/clemens/core_data/composer-packages/CoreLibs-Composer-All",
"reference": "0e6a43a2c286dcd78720287c344891db633edbfd"
"reference": "f2d537734722059e6342d3cdc44ece9f63a50382"
},
"require": {
"php": ">=8.1"

View File

@@ -2,12 +2,12 @@
"packages": [
{
"name": "egrajp/corelibs-composer-all",
"version": "dev-development",
"version_normalized": "dev-development",
"version": "dev-master",
"version_normalized": "dev-master",
"dist": {
"type": "path",
"url": "/storage/var/www/html/developers/clemens/core_data/composer-packages/CoreLibs-Composer-All",
"reference": "0e6a43a2c286dcd78720287c344891db633edbfd"
"reference": "f2d537734722059e6342d3cdc44ece9f63a50382"
},
"require": {
"php": ">=8.1"

View File

@@ -11,9 +11,9 @@
),
'versions' => array(
'egrajp/corelibs-composer-all' => array(
'pretty_version' => 'dev-development',
'version' => 'dev-development',
'reference' => '0e6a43a2c286dcd78720287c344891db633edbfd',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'f2d537734722059e6342d3cdc44ece9f63a50382',
'type' => 'library',
'install_path' => __DIR__ . '/../egrajp/corelibs-composer-all',
'aliases' => array(),

View File

@@ -1 +1 @@
8.1.1
8.1.2

View File

@@ -31,6 +31,7 @@ source .env.deploy;
cd -;
set +o allexport;
echo "[START]";
# gitea
if [ ! -z "${GITEA_USER}" ] && [ ! -z "${GITEA_TOKEN}" ]; then
curl -LJO \
@@ -56,5 +57,7 @@ if [ ! -z "${GITLAB_DEPLOY_TOKEN}" ]; then
else
echo "Missing GITLAB_DEPLOY_TOKEN environment variable";
fi;
echo "";
echo "[DONE]";
# __END__

View File

@@ -280,7 +280,7 @@ class IO
/** @var string default hash type */
public const ERROR_HASH_TYPE = 'adler32';
/** @var string regex to get returning with matches at position 1 */
public const REGEX_RETURNING = '/\s+returning\s+(.+?);?$/i';
public const REGEX_RETURNING = '/\s+returning\s+(.+\s*(?:.+\s*)+);?$/i';
// recommend to set private/protected and only allow setting via method
// can bet set from outside