diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile index 4adf9bae5..3e7c4ccdc 100644 --- a/.docker/php/Dockerfile +++ b/.docker/php/Dockerfile @@ -1,23 +1,53 @@ ARG PHP_VERSION=8.1 -FROM php:${PHP_VERSION}-cli-alpine +FROM php:${PHP_VERSION}-cli-bookworm -RUN apk add --no-cache \ - libpq-dev \ - libzip-dev \ - git \ - zip \ - unzip && \ - rm -rf /var/cache/apk/* && \ - rm -rf /tmp/* +# Update dependencies list +RUN apt-get clean all \ + && apt-get update \ + && apt-get autoremove +# Base dependencies +RUN apt-get install -y --no-install-recommends \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg \ + libpq-dev \ + libzip-dev \ + git \ + zip \ + unzip + +# PHP extensions RUN docker-php-ext-install -j$(nproc) pdo pdo_mysql pdo_pgsql zip mysqli pgsql +# Microsoft repo (Debian 12 / bookworm) +RUN set -eux; \ + mkdir -p /etc/apt/keyrings; \ + curl -fsSL https://packages.microsoft.com/keys/microsoft.asc \ + | gpg --dearmor > /etc/apt/keyrings/microsoft.gpg; \ + chmod 0644 /etc/apt/keyrings/microsoft.gpg; \ + echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/debian/12/prod bookworm main" \ + > /etc/apt/sources.list.d/microsoft-prod.list; \ + apt-get update; \ + ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18 mssql-tools18; \ + echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' > /etc/profile.d/mssql-tools.sh; + +# PHP SQL Server extensions +RUN apt-get update && apt-get install -y --no-install-recommends \ + unixodbc unixodbc-dev \ + $PHPIZE_DEPS +RUN pecl install sqlsrv pdo_sqlsrv \ + && docker-php-ext-enable sqlsrv pdo_sqlsrv + +# Create user ARG PUID=1000 ARG PGID=1000 -RUN addgroup -g ${PGID} -S php && \ - adduser -u ${PUID} -S -G php -h /home/php -s /bin/bash php && \ - mkdir -p /app && chown -R php:php /app +RUN groupadd -g ${PGID} php && \ + useradd -l -u ${PUID} -g php php && \ + install -d -m 0755 -o php -g php /home/php +# Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer RUN chown php:php /usr/bin/composer diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fffee3e9d..51bb6e3a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,8 +8,7 @@ on: paths-ignore: - doc/** branches: - - main - - v*.* + - '**' env: php-extensions: mbstring, intl, mysqli, pgsql, sqlsrv-5.10.0beta2 @@ -22,6 +21,10 @@ jobs: runs-on: ubuntu-latest + if: | + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + strategy: matrix: php-version: [ '8.1', '8.2', '8.3', '8.4' ] @@ -55,6 +58,10 @@ jobs: tests: name: Tests + if: | + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + strategy: fail-fast: false matrix: @@ -211,6 +218,9 @@ jobs: name: Code coverage finish needs: tests runs-on: ubuntu-latest + if: | + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - name: Coveralls Finished env: diff --git a/.phpstan.neon b/.phpstan.neon index d045babe9..dd44ebf0d 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -23,6 +23,7 @@ parameters: - { identifier: method.internalClass } - { identifier: new.internalClass } - '#Call to static method Tester\\Assert::type\(\).+will always evaluate to true\.#' + - '#^Access to deprecated static property \$collectionGetByWithLimitClause of class Nextras\\Orm\\FeatureToggle(.+)#' services: - diff --git a/contributing.md b/contributing.md index d82dc98fb..f4368ccd5 100644 --- a/contributing.md +++ b/contributing.md @@ -24,6 +24,8 @@ To set up tests configuration, copy [databases.sample.ini](tests/databases.sampl ```ini ; databases.ini example +[array] + [mysql] driver = mysqli host = "mysql" @@ -37,6 +39,14 @@ host = "pgsql" database = nextras_orm_test username = postgres password = postgres + +[sqlsrv] +driver = sqlsrv +host = "sqlsrv" +username = SA +password = "YourStrong!Passw0rd" +database = nextras_orm_test +TrustServerCertificate = true ``` ```bash diff --git a/docker-compose.yml b/docker-compose.yml index 22577f6df..b1f86ecf6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: --innodb-doublewrite=0 --skip-log-bin pgsql: - image: postgres:${PGSQL_VERSION:-latest} + image: postgres:${PGSQL_VERSION:-17} environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -22,6 +22,19 @@ services: -c fsync=off -c synchronous_commit=off -c full_page_writes=off + sqlsrv: + image: mcr.microsoft.com/mssql/server:${MSSQL_VERSION:-2025-latest} + environment: + ACCEPT_EULA: "Y" + MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD:-YourStrong!Passw0rd} + MSSQL_PID: "Developer" + tmpfs: + - /var/opt/mssql:rw,uid=10001,gid=0,mode=0775,size=1g + healthcheck: + test: ["CMD-SHELL", "pidof sqlservr >/dev/null || exit 1"] + interval: 5s + timeout: 3s + retries: 30 php: build: context: .docker/php diff --git a/src/Collection/DbalCollection.php b/src/Collection/DbalCollection.php index 1244a27d7..f06fe9e99 100644 --- a/src/Collection/DbalCollection.php +++ b/src/Collection/DbalCollection.php @@ -17,6 +17,7 @@ use Nextras\Orm\Exception\InvalidStateException; use Nextras\Orm\Exception\MemberAccessException; use Nextras\Orm\Exception\NoResultException; +use Nextras\Orm\FeatureToggle; use Nextras\Orm\Mapper\Dbal\DbalMapper; use Nextras\Orm\Mapper\IRelationshipMapper; use function count; @@ -71,13 +72,28 @@ public function __construct( public function getBy(array $conds): ?IEntity { - return $this->findBy($conds)->fetch(); + $collection = $this->findBy($conds); + if (FeatureToggle::$collectionGetByWithLimitClause + // Skipped for SqlServer because it does not support syntax generated by nextras/dbal + && $this->connection->getPlatform()->getName() !== SqlServerPlatform::NAME + ) { + $collection = $collection->limitBy(1); + } + + return $collection->fetch(); } public function getByChecked(array $conds): IEntity { - return $this->findBy($conds)->fetchChecked(); + $collection = $this->findBy($conds); + if (FeatureToggle::$collectionGetByWithLimitClause + // Skipped for SqlServer because it does not support syntax generated by nextras/dbal + && $this->connection->getPlatform()->getName() !== SqlServerPlatform::NAME) { + $collection = $collection->limitBy(1); + } + + return $collection->fetchChecked(); } diff --git a/src/FeatureToggle.php b/src/FeatureToggle.php new file mode 100644 index 000000000..c16711c7b --- /dev/null +++ b/src/FeatureToggle.php @@ -0,0 +1,11 @@ +reconnectWithConfig( ['database' => 'tempdb'] + $connection->getConfig() ); - $connection->query('DROP DATABASE nextras_orm_test'); - $connection->query('CREATE DATABASE nextras_orm_test'); + $connection->query('DROP DATABASE IF EXISTS %table', $dbname); + $connection->query('CREATE DATABASE %table', $dbname); $connection->reconnectWithConfig( - ['database' => 'nextras_orm_test'] + $connection->getConfig() + ['database' => $dbname] + $connection->getConfig() ); }; diff --git a/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testBasic.sql b/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testBasic.sql index 2b406d5c8..cf6378ab1 100644 --- a/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testBasic.sql +++ b/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testBasic.sql @@ -1,9 +1,9 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; UPDATE "books" SET "price" = 1000, "price_currency" = 'CZK' WHERE "id" = 1; COMMIT; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; UPDATE "books" SET "price" = NULL, "price_currency" = NULL WHERE "id" = 1; COMMIT; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testMultiple.sql b/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testMultiple.sql index a5f395baf..1c5dd8bdb 100644 --- a/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testMultiple.sql +++ b/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testMultiple.sql @@ -1,5 +1,5 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; UPDATE "books" SET "price" = 1000, "price_currency" = 'CZK', "orig_price_cents" = 330, "orig_price_currency" = 'EUR' WHERE "id" = 1; COMMIT; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testNonNull.sql b/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testNonNull.sql index 6a74fc2fe..d86db7d2b 100644 --- a/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testNonNull.sql +++ b/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testNonNull.sql @@ -1 +1 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testNull.sql b/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testNull.sql index 6a74fc2fe..d86db7d2b 100644 --- a/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testNull.sql +++ b/tests/sqls/NextrasTests/Orm/Entity/EntityEmbeddableTest_testNull.sql @@ -1 +1 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionEmbeddablesTest_testBasics.sql b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionEmbeddablesTest_testBasics.sql index 6fb85e19f..a5989d3da 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionEmbeddablesTest_testBasics.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionEmbeddablesTest_testBasics.sql @@ -1,6 +1,6 @@ SELECT "books".* FROM "books" AS "books" WHERE "books"."price" >= 1000; SELECT COUNT(*) AS count FROM (SELECT "books"."id" FROM "books" AS "books" WHERE "books"."price" >= 1000) temp; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; UPDATE "books" SET "price" = 1000, "price_currency" = 'CZK' WHERE "id" = 1; COMMIT; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionEmbeddablesTest_testOrderBy.sql b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionEmbeddablesTest_testOrderBy.sql index cea4b3935..7bf2b47ba 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionEmbeddablesTest_testOrderBy.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionEmbeddablesTest_testOrderBy.sql @@ -1,5 +1,5 @@ SELECT "books".* FROM "books" AS "books" ORDER BY "books"."price" ASC; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC, "books"."price" DESC; SELECT "authors".* diff --git a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testCountInCycle.sql b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testCountInCycle.sql index 925422d00..9dedfa7ca 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testCountInCycle.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testCountInCycle.sql @@ -1,2 +1,2 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testJoinDifferentPath.sql b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testJoinDifferentPath.sql index aed6e3724..b6699d588 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testJoinDifferentPath.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testJoinDifferentPath.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3 LIMIT 1; START TRANSACTION; INSERT INTO "eans" ("code", "type") VALUES ('123', 2); SELECT CURRVAL('public.eans_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testNonNullable.sql b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testNonNullable.sql index 6b4734ba4..855d8addc 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testNonNullable.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testNonNullable.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 923; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 923; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 923 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 923 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testPrimaryProxy.sql b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testPrimaryProxy.sql index ea09db8e2..8dc5dd618 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testPrimaryProxy.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testPrimaryProxy.sql @@ -1 +1 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testQueryByEntity.sql b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testQueryByEntity.sql index 14d67da19..7030a4b55 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testQueryByEntity.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionTest_testQueryByEntity.sql @@ -1,6 +1,6 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; SELECT COUNT(*) AS count FROM (SELECT "books"."id" FROM "books" AS "books" WHERE "books"."author_id" = 1) temp; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT COUNT(*) AS count FROM (SELECT "books"."id" FROM "books" AS "books" WHERE "books"."author_id" IN (1, 2)) temp; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1, 2); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionWhereTest_testFilterByPropertyWrapper.sql b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionWhereTest_testFilterByPropertyWrapper.sql index e25a29554..dd63b6280 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionWhereTest_testFilterByPropertyWrapper.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Collection/CollectionWhereTest_testFilterByPropertyWrapper.sql @@ -1,9 +1,9 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "eans" ("code", "type") VALUES ('123', 2); SELECT CURRVAL('public.eans_id_seq'); UPDATE "books" SET "ean_id" = 1 WHERE "id" = 1; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2 LIMIT 1; INSERT INTO "eans" ("code", "type") VALUES ('456', 1); SELECT CURRVAL('public.eans_id_seq'); UPDATE "books" SET "ean_id" = 2 WHERE "id" = 2; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCloningTest_testCloningOneHasMany.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCloningTest_testCloningOneHasMany.sql index 90b8c223f..745951fd3 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCloningTest_testCloningOneHasMany.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCloningTest_testCloningOneHasMany.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testCompositePKDateTime.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testCompositePKDateTime.sql index 23bf6ff71..96ea73426 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testCompositePKDateTime.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testCompositePKDateTime.sql @@ -4,7 +4,7 @@ COMMIT; START TRANSACTION; INSERT INTO "user_stats" ("user_id", "date", "value") VALUES (1, '2018-09-09 08:09:02.000000'::timestamptz, 100); COMMIT; -SELECT "user_stats".* FROM "user_stats" AS "user_stats" WHERE ("user_stats"."user_id" = 1) AND ("user_stats"."date" = '2018-09-09 08:09:02.000000'::timestamptz); +SELECT "user_stats".* FROM "user_stats" AS "user_stats" WHERE ("user_stats"."user_id" = 1) AND ("user_stats"."date" = '2018-09-09 08:09:02.000000'::timestamptz) LIMIT 1; START TRANSACTION; UPDATE "user_stats" SET "value" = 101 WHERE "user_id" = 1 AND "date" = '2018-09-09 08:09:02.000000'::timestamptz; COMMIT; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testCompositePKDateTime2.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testCompositePKDateTime2.sql index 6f8bcd0be..32b782cab 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testCompositePKDateTime2.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testCompositePKDateTime2.sql @@ -5,8 +5,8 @@ COMMIT; START TRANSACTION; INSERT INTO "user_stats_x" ("user_id", "date", "value") VALUES (1, '2019-01-01'::date, 100); COMMIT; -SELECT "user_stats_x".* FROM "user_stats_x" AS "user_stats_x" WHERE "user_stats_x"."date" = '2019-01-01'::date; +SELECT "user_stats_x".* FROM "user_stats_x" AS "user_stats_x" WHERE "user_stats_x"."date" = '2019-01-01'::date LIMIT 1; START TRANSACTION; UPDATE "user_stats_x" SET "value" = 200 WHERE "user_id" = 1 AND "date" = '2019-01-01'::date; COMMIT; -SELECT "user_stats_x".* FROM "user_stats_x" AS "user_stats_x" WHERE "user_stats_x"."date" = '2019-01-01'::date; +SELECT "user_stats_x".* FROM "user_stats_x" AS "user_stats_x" WHERE "user_stats_x"."date" = '2019-01-01'::date LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testGetBy.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testGetBy.sql index 084c6c12a..fad3dc9fa 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testGetBy.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testGetBy.sql @@ -1,4 +1,4 @@ -SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."tag_id" = 3) AND ("tag_followers"."author_id" = 1); +SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."tag_id" = 3) AND ("tag_followers"."author_id" = 1) LIMIT 1; SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" IN (3); SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); -SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."author_id" = 1) AND ("tag_followers"."tag_id" = 3); +SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."author_id" = 1) AND ("tag_followers"."tag_id" = 3) LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testGetById.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testGetById.sql index d1d47ebfa..f8773fe62 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testGetById.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testGetById.sql @@ -1,4 +1,4 @@ -SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."author_id", "tag_followers"."tag_id") IN ((1, 3)); +SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."author_id", "tag_followers"."tag_id") IN ((1, 3)) LIMIT 1; SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" IN (3); SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); -SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."author_id", "tag_followers"."tag_id") IN ((3, 1)); +SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."author_id", "tag_followers"."tag_id") IN ((3, 1)) LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityEnumPropTest_testAddEntityWithDefaultEnum.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityEnumPropTest_testAddEntityWithDefaultEnum.sql index ced6cfa13..b08b611d5 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityEnumPropTest_testAddEntityWithDefaultEnum.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityEnumPropTest_testAddEntityWithDefaultEnum.sql @@ -6,4 +6,4 @@ SELECT CURRVAL('public.publishers_publisher_id_seq'); INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('Book 6', 3, NULL, NULL, NULL, 4, 'fantasy', '2021-12-14 21:10:02.000000'::timestamp, NULL, NULL, 150, 'CZK', NULL, NULL); SELECT CURRVAL('public.books_id_seq'); COMMIT; -SELECT "books".* FROM "books" AS "books" WHERE "books"."title" = 'Book 6'; +SELECT "books".* FROM "books" AS "books" WHERE "books"."title" = 'Book 6' LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityEnumPropTest_testAddEntityWithEnum.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityEnumPropTest_testAddEntityWithEnum.sql index 8ee1117a0..0ef478bfb 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityEnumPropTest_testAddEntityWithEnum.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityEnumPropTest_testAddEntityWithEnum.sql @@ -7,4 +7,4 @@ INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id SELECT CURRVAL('public.books_id_seq'); UPDATE "books" SET "genre" = 'romance' WHERE "id" = 5; COMMIT; -SELECT "books".* FROM "books" AS "books" WHERE "books"."title" = 'Book 5'; +SELECT "books".* FROM "books" AS "books" WHERE "books"."title" = 'Book 5' LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityPkTest_testDateTimeWithProxyPkUpdate.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityPkTest_testDateTimeWithProxyPkUpdate.sql index 7af048125..179f69ea7 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityPkTest_testDateTimeWithProxyPkUpdate.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityPkTest_testDateTimeWithProxyPkUpdate.sql @@ -1,8 +1,8 @@ START TRANSACTION; INSERT INTO "time_series" ("date", "value") VALUES ('2022-03-06 03:03:03.000000'::timestamptz, 3); COMMIT; -SELECT "time_series".* FROM "time_series" AS "time_series" WHERE "time_series"."date" = '2022-03-06 03:03:03.000000'::timestamptz; +SELECT "time_series".* FROM "time_series" AS "time_series" WHERE "time_series"."date" = '2022-03-06 03:03:03.000000'::timestamptz LIMIT 1; START TRANSACTION; UPDATE "time_series" SET "value" = 5 WHERE "date" = '2022-03-06 03:03:03.000000'::timestamptz; COMMIT; -SELECT "time_series".* FROM "time_series" AS "time_series" WHERE "time_series"."date" = '2022-03-06 03:03:03.000000'::timestamptz; +SELECT "time_series".* FROM "time_series" AS "time_series" WHERE "time_series"."date" = '2022-03-06 03:03:03.000000'::timestamptz LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityPreloadContainerTest_testWithEntityWithInvalidRelationshipState.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityPreloadContainerTest_testWithEntityWithInvalidRelationshipState.sql index 5eb8dcee1..911964b4f 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityPreloadContainerTest_testWithEntityWithInvalidRelationshipState.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntityPreloadContainerTest_testWithEntityWithInvalidRelationshipState.sql @@ -1,4 +1,4 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE "tag_followers"."author_id" IN (1); SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntitySetReadOnlyValueTest_testWithIPropertyWrapper.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntitySetReadOnlyValueTest_testWithIPropertyWrapper.sql index 7e4a08650..f44b33328 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/EntitySetReadOnlyValueTest_testWithIPropertyWrapper.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/EntitySetReadOnlyValueTest_testWithIPropertyWrapper.sql @@ -1,2 +1,2 @@ -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1; -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1 LIMIT 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Entity/UpdateEntityTest_testUpdate.sql b/tests/sqls/NextrasTests/Orm/Integration/Entity/UpdateEntityTest_testUpdate.sql index 81b42dd53..9ae97214a 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Entity/UpdateEntityTest_testUpdate.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Entity/UpdateEntityTest_testUpdate.sql @@ -1,4 +1,4 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; START TRANSACTION; UPDATE "public"."authors" SET "name" = 'Test Testcase' WHERE "id" = 1; COMMIT; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Mapper/ConventionsTest_testTimezoneDetection.sql b/tests/sqls/NextrasTests/Orm/Integration/Mapper/ConventionsTest_testTimezoneDetection.sql index ceaa06d55..62cb980fe 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Mapper/ConventionsTest_testTimezoneDetection.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Mapper/ConventionsTest_testTimezoneDetection.sql @@ -6,4 +6,4 @@ SELECT CURRVAL('public.publishers_publisher_id_seq'); INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('B', 3, NULL, NULL, NULL, 4, 'fantasy', '2015-09-09 10:10:10.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); SELECT CURRVAL('public.books_id_seq'); COMMIT; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 5; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 5 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Mapper/MapperDateTimeSimpleTest_testToCollection.sql b/tests/sqls/NextrasTests/Orm/Integration/Mapper/MapperDateTimeSimpleTest_testToCollection.sql index 613a270bf..30465a83c 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Mapper/MapperDateTimeSimpleTest_testToCollection.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Mapper/MapperDateTimeSimpleTest_testToCollection.sql @@ -2,4 +2,4 @@ START TRANSACTION; INSERT INTO "public"."authors" ("name", "born_on", "web", "favorite_author_id") VALUES ('Random Author', '2018-01-09'::date, 'http://www.example.com', NULL); SELECT CURRVAL('public.authors_id_seq'); COMMIT; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 3; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 3 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelClearTest_testBasics.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelClearTest_testBasics.sql index f6afe7dec..fe80e04e6 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelClearTest_testBasics.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelClearTest_testBasics.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testAllowOverwrite.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testAllowOverwrite.sql index 85e5c7cbc..abefcc9eb 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testAllowOverwrite.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testAllowOverwrite.sql @@ -1,2 +1,2 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testBasics.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testBasics.sql index 361fff4b7..11e868ee9 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testBasics.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testBasics.sql @@ -1,5 +1,5 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2 LIMIT 1; UPDATE "books" SET "title" = 'foo' WHERE id = 1; UPDATE "books" SET "title" = 'bar' WHERE id = 2; SELECT "books".* FROM "books" AS "books" WHERE "books"."id" IN (1, 2); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testDelete.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testDelete.sql index e0f8eb4b9..6de956b50 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testDelete.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testDelete.sql @@ -1,3 +1,3 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; DELETE FROM "books" WHERE id = 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testDisallowOverwrite.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testDisallowOverwrite.sql index 6a74fc2fe..d86db7d2b 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testDisallowOverwrite.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testDisallowOverwrite.sql @@ -1 +1 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testMHMRelations.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testMHMRelations.sql index f1cd965ec..f27ad8580 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testMHMRelations.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testMHMRelations.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2 LIMIT 1; SELECT "books_x_tags"."tag_id", "books_x_tags"."book_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testMHMRelations2.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testMHMRelations2.sql index ce35c3c6c..dbe71b199 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testMHMRelations2.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testMHMRelations2.sql @@ -1,4 +1,4 @@ -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 3; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 3 LIMIT 1; SELECT "books_x_tags"."book_id", "books_x_tags"."tag_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testOHMRelations.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testOHMRelations.sql index a9f477fcf..8c69f0179 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testOHMRelations.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testOHMRelations.sql @@ -1,6 +1,6 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 2; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 2 LIMIT 1; SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" IN (1); SELECT "books".* FROM "books" AS "books" WHERE "books"."publisher_id" IN (1); SELECT "books".* FROM "books" AS "books" WHERE "books"."publisher_id" IN (2); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testOHORelations.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testOHORelations.sql index 7432fe422..8ee727b9a 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testOHORelations.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testOHORelations.sql @@ -1,7 +1,7 @@ INSERT INTO "eans" ("id", "code", "type") VALUES (1, '111', 2); UPDATE "books" SET "ean_id" = 1 WHERE id = 1; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."id" = 1 LIMIT 1; SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."id" IN (1); INSERT INTO "eans" ("id", "code", "type") VALUES (2, '222', 2); UPDATE "books" SET "ean_id" = 2 WHERE id = 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testTrackedMHM.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testTrackedMHM.sql index fe2b1cfe2..06082ef7e 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testTrackedMHM.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testTrackedMHM.sql @@ -1,5 +1,5 @@ -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 3; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 3 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2 LIMIT 1; SELECT "books_x_tags"."book_id", "books_x_tags"."tag_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testTrackedOHM.sql b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testTrackedOHM.sql index 977bbc314..3a4a29290 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testTrackedOHM.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Model/ModelRefreshAllTest_testTrackedOHM.sql @@ -1,5 +1,5 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."publisher_id" IN (1); START TRANSACTION; UPDATE "books" SET "title" = 'abc' WHERE "id" = 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCache.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCache.sql index 22d89b656..f9df5a696 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCache.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCache.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books_x_tags"."tag_id", "books_x_tags"."book_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCaching.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCaching.sql index 657ee8b8b..1208a8af9 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCaching.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCaching.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books_x_tags"."tag_id", "books_x_tags"."book_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCachingPreload.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCachingPreload.sql index a545b3a28..8b1dd0eef 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCachingPreload.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCachingPreload.sql @@ -11,48 +11,54 @@ WHERE "books_x_tags"."book_id" IN (1, 2, 3, 4); SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" IN (1, 2, 3); -SELECT - "books_x_tags"."tag_id", - "books_x_tags"."book_id" -FROM - "tags" AS "tags" - LEFT JOIN "books_x_tags" AS "books_x_tags" ON ( - "books_x_tags"."tag_id" = "tags"."id" - ) -WHERE - ("tags"."id" = 1) - AND ( - "books_x_tags"."book_id" IN (2) - ); +( + SELECT + "books_x_tags"."tag_id", + "books_x_tags"."book_id" + FROM + "tags" AS "tags" + LEFT JOIN "books_x_tags" AS "books_x_tags" ON ( + "books_x_tags"."tag_id" = "tags"."id" + ) + WHERE + ("tags"."id" = 1) + AND ("books_x_tags"."book_id" = 2) + LIMIT + 1 +); -SELECT - "books_x_tags"."tag_id", - "books_x_tags"."book_id" -FROM - "tags" AS "tags" - LEFT JOIN "books_x_tags" AS "books_x_tags" ON ( - "books_x_tags"."tag_id" = "tags"."id" - ) -WHERE - ("tags"."id" = 2) - AND ( - "books_x_tags"."book_id" IN (2) - ); +( + SELECT + "books_x_tags"."tag_id", + "books_x_tags"."book_id" + FROM + "tags" AS "tags" + LEFT JOIN "books_x_tags" AS "books_x_tags" ON ( + "books_x_tags"."tag_id" = "tags"."id" + ) + WHERE + ("tags"."id" = 2) + AND ("books_x_tags"."book_id" = 2) + LIMIT + 1 +); SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" IN (2); -SELECT - "books_x_tags"."tag_id", - "books_x_tags"."book_id" -FROM - "tags" AS "tags" - LEFT JOIN "books_x_tags" AS "books_x_tags" ON ( - "books_x_tags"."tag_id" = "tags"."id" - ) -WHERE - ("tags"."id" = 3) - AND ( - "books_x_tags"."book_id" IN (2) - ); +( + SELECT + "books_x_tags"."tag_id", + "books_x_tags"."book_id" + FROM + "tags" AS "tags" + LEFT JOIN "books_x_tags" AS "books_x_tags" ON ( + "books_x_tags"."tag_id" = "tags"."id" + ) + WHERE + ("tags"."id" = 3) + AND ("books_x_tags"."book_id" = 2) + LIMIT + 1 +); SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" IN (3); -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 4; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 4 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCollectionCountWithLimit.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCollectionCountWithLimit.sql index 2e77fd9e2..c2800c0b7 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCollectionCountWithLimit.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCollectionCountWithLimit.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; ( SELECT "books_x_tags"."tag_id", diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCountAfterRemoveAndFlushAndCount.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCountAfterRemoveAndFlushAndCount.sql index ab42e8568..3ded12531 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCountAfterRemoveAndFlushAndCount.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCountAfterRemoveAndFlushAndCount.sql @@ -1,5 +1,5 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "tags" ("name", "is_global") VALUES ('Testing Tag', 'y'); SELECT CURRVAL('public.tags_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCountStoredOnManyHasManyRelationshipCondition.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCountStoredOnManyHasManyRelationshipCondition.sql index 1f7c3de63..e1655d90e 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCountStoredOnManyHasManyRelationshipCondition.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testCountStoredOnManyHasManyRelationshipCondition.sql @@ -1,4 +1,4 @@ -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1 LIMIT 1; SELECT "books_x_tags"."book_id", "books_x_tags"."tag_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testIsModified.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testIsModified.sql index e1c830608..fe3156104 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testIsModified.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testIsModified.sql @@ -1,2 +1,2 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testLimit.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testLimit.sql index 840bfbf7e..6a94a6d59 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testLimit.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testLimit.sql @@ -1,5 +1,5 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 3; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 3 LIMIT 1; START TRANSACTION; INSERT INTO "books_x_tags" ("book_id", "tag_id") VALUES (1, 3); COMMIT; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRawValue.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRawValue.sql index d1558397c..7989d76d7 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRawValue.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRawValue.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books_x_tags"."tag_id", "books_x_tags"."book_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRemove.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRemove.sql index 922f6d06d..6d10ed017 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRemove.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRemove.sql @@ -1,5 +1,5 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1 LIMIT 1; START TRANSACTION; DELETE FROM "books_x_tags" WHERE ("book_id", "tag_id") IN ((1, 1)); COMMIT; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRepeatedPersisting.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRepeatedPersisting.sql index 3aecb549c..93357c260 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRepeatedPersisting.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testRepeatedPersisting.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "tags" ("name", "is_global") VALUES ('A', 'y'); SELECT CURRVAL('public.tags_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testSymmetricRelationship.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testSymmetricRelationship.sql index 548579dea..b5100d619 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testSymmetricRelationship.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasManyTest_testSymmetricRelationship.sql @@ -1,6 +1,6 @@ -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2 LIMIT 1; SELECT "books_x_tags"."book_id", "books_x_tags"."tag_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testAutoConnection.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testAutoConnection.sql index 74821291b..557974acb 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testAutoConnection.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testAutoConnection.sql @@ -1,3 +1,3 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testCache.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testCache.sql index 1f6431010..348fba9d4 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testCache.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testCache.sql @@ -1,4 +1,4 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (2) ORDER BY "books"."id" DESC LIMIT 1; SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" IN (1); SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (2) ORDER BY "books"."id" DESC; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testHasValue.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testHasValue.sql index 6a74fc2fe..d86db7d2b 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testHasValue.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipManyHasOneTest_testHasValue.sql @@ -1 +1 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyCompositePkTest_testHasMany.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyCompositePkTest_testHasMany.sql index 403b25421..84ff375f6 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyCompositePkTest_testHasMany.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyCompositePkTest_testHasMany.sql @@ -1,3 +1,3 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE "tag_followers"."author_id" IN (1); SELECT "author_id", COUNT(DISTINCT "tag_followers"."tag_id") as "count" FROM "tag_followers" AS "tag_followers" WHERE "tag_followers"."author_id" IN (1) GROUP BY "author_id"; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyCompositePkTest_testRemoveHasMany.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyCompositePkTest_testRemoveHasMany.sql index 97d34f8f0..e6cf5b215 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyCompositePkTest_testRemoveHasMany.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyCompositePkTest_testRemoveHasMany.sql @@ -1,4 +1,4 @@ -SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."tag_id" = 3) AND ("tag_followers"."author_id" = 1); +SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE ("tag_followers"."tag_id" = 3) AND ("tag_followers"."author_id" = 1) LIMIT 1; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" IN (3); START TRANSACTION; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyRemoveTest_testRemoveItem.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyRemoveTest_testRemoveItem.sql index 76a551765..4de737c6d 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyRemoveTest_testRemoveItem.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyRemoveTest_testRemoveItem.sql @@ -1,5 +1,5 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3 LIMIT 1; START TRANSACTION; UPDATE "books" SET "translator_id" = NULL WHERE "id" = 3; COMMIT; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testBasics.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testBasics.sql index 6a5197dcf..67eb7ef7a 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testBasics.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testBasics.sql @@ -1,4 +1,4 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE ("books"."title" != 'Book 1') AND ("books"."author_id" IN (1)) ORDER BY "books"."id" DESC; SELECT "author_id", COUNT(DISTINCT "books"."id") as "count" FROM "books" AS "books" WHERE ("books"."title" != 'Book 1') AND ("books"."author_id" IN (1)) GROUP BY "author_id"; SELECT "books".* FROM "books" AS "books" WHERE ("books"."title" != 'Book 3') AND ("books"."author_id" IN (1)) ORDER BY "books"."id" DESC; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testCachingBasic.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testCachingBasic.sql index c96819625..063ed62b1 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testCachingBasic.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testCachingBasic.sql @@ -1,4 +1,4 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE ("books"."translator_id" IS NULL) AND ("books"."author_id" IN (1)) ORDER BY "books"."id" DESC; START TRANSACTION; UPDATE "books" SET "translator_id" = 1 WHERE "id" = 2; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testCountOnCompositePkInTargetTable.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testCountOnCompositePkInTargetTable.sql index 5f8d0421a..172868152 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testCountOnCompositePkInTargetTable.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testCountOnCompositePkInTargetTable.sql @@ -1,7 +1,7 @@ -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; START TRANSACTION; INSERT INTO "tag_followers" ("created_at", "author_id", "tag_id") VALUES ('2021-12-02 19:21:00.000000'::timestamptz, 2, 1); COMMIT; -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1 LIMIT 1; SELECT "tag_id", COUNT(DISTINCT "tag_followers"."author_id") as "count" FROM "tag_followers" AS "tag_followers" WHERE "tag_followers"."tag_id" IN (1) GROUP BY "tag_id"; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testOrderByDifferentTableColumnOnHasManyRelationshipCondition.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testOrderByDifferentTableColumnOnHasManyRelationshipCondition.sql index 0f6bed16f..a36f3fba4 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testOrderByDifferentTableColumnOnHasManyRelationshipCondition.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testOrderByDifferentTableColumnOnHasManyRelationshipCondition.sql @@ -1,4 +1,4 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; SELECT "books".* FROM diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testOrderingWithJoins.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testOrderingWithJoins.sql index 9cd1b9c77..960e47f4e 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testOrderingWithJoins.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testOrderingWithJoins.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "books".* diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testRawValue.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testRawValue.sql index b636b6c9b..14c6f150a 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testRawValue.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testRawValue.sql @@ -1,4 +1,4 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testUniqueConstraintException.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testUniqueConstraintException.sql index 8d84a4bac..aa44c5272 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testUniqueConstraintException.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testUniqueConstraintException.sql @@ -1,9 +1,9 @@ -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; START TRANSACTION; INSERT INTO "tag_followers" ("created_at", "author_id", "tag_id") VALUES ('2021-12-02 19:21:00.000000'::timestamptz, 2, 2); ROLLBACK; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "tag_followers" ("created_at", "author_id", "tag_id") VALUES ('2021-12-02 19:21:00.000000'::timestamptz, 1, 2); COMMIT; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testWithDifferentPrimaryKey.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testWithDifferentPrimaryKey.sql index e43ac424e..131b6b20d 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testWithDifferentPrimaryKey.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasManyTest_testWithDifferentPrimaryKey.sql @@ -1,2 +1,2 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."publisher_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testAccessFromNonMainSide.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testAccessFromNonMainSide.sql index 64b9da03d..efa7f97b3 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testAccessFromNonMainSide.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testAccessFromNonMainSide.sql @@ -1,10 +1,10 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "eans" ("code", "type") VALUES ('GoTEAN', 2); SELECT CURRVAL('public.eans_id_seq'); INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('GoT', 1, NULL, NULL, 1, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); SELECT CURRVAL('public.books_id_seq'); COMMIT; -SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."id" = 1; +SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."ean_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testCascadeRemove.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testCascadeRemove.sql index 77fd45b6d..0a9b36135 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testCascadeRemove.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testCascadeRemove.sql @@ -1,10 +1,10 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "eans" ("code", "type") VALUES ('1234', 2); SELECT CURRVAL('public.eans_id_seq'); UPDATE "books" SET "ean_id" = 1 WHERE "id" = 1; COMMIT; -SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."id" = 1; +SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."ean_id" IN (1); SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); @@ -27,4 +27,4 @@ DELETE FROM "books_x_tags" WHERE ("book_id", "tag_id") IN ((1, 1), (1, 2)); DELETE FROM "books" WHERE "id" = 1; DELETE FROM "eans" WHERE "id" = 1; COMMIT; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testCollection.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testCollection.sql index 1f1dfe4b4..aaf9c0344 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testCollection.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testCollection.sql @@ -1,5 +1,5 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "eans" ("code", "type") VALUES ('GoTEAN', 2); SELECT CURRVAL('public.eans_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testGetRawValue.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testGetRawValue.sql index 819a47d13..fcbafacad 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testGetRawValue.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testGetRawValue.sql @@ -1,8 +1,8 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "eans" ("code", "type") VALUES ('1234', 2); SELECT CURRVAL('public.eans_id_seq'); UPDATE "books" SET "ean_id" = 1 WHERE "id" = 1; COMMIT; -SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."id" = 1; +SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."ean_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testHasValue.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testHasValue.sql index 6292e8831..5dee5fd09 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testHasValue.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testHasValue.sql @@ -1,8 +1,8 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "eans" ("code", "type") VALUES ('1234', 2); SELECT CURRVAL('public.eans_id_seq'); UPDATE "books" SET "ean_id" = 1 WHERE "id" = 1; COMMIT; -SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."code" = '1234'; +SELECT "eans".* FROM "eans" AS "eans" WHERE "eans"."code" = '1234' LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."ean_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testPersistence.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testPersistence.sql index 324a2127f..b47001fe3 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testPersistence.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testPersistence.sql @@ -1,7 +1,7 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 2; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 2 LIMIT 1; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('Games of Thrones II', 2, NULL, NULL, NULL, 2, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); SELECT CURRVAL('public.books_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testPersistenceFromOtherSide.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testPersistenceFromOtherSide.sql index 324a2127f..b47001fe3 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testPersistenceFromOtherSide.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testPersistenceFromOtherSide.sql @@ -1,7 +1,7 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 2; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 2 LIMIT 1; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('Games of Thrones II', 2, NULL, NULL, NULL, 2, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); SELECT CURRVAL('public.books_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testQueryBuilder.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testQueryBuilder.sql index 07968f53f..dc276b5ea 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testQueryBuilder.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testQueryBuilder.sql @@ -1,5 +1,5 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "eans" ("code", "type") VALUES ('1234', 2); SELECT CURRVAL('public.eans_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testReadOnNullable.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testReadOnNullable.sql index 9969393a9..0759d4427 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testReadOnNullable.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testReadOnNullable.sql @@ -5,5 +5,5 @@ INSERT INTO "photos" ("title", "album_id") VALUES ('Test', 1); SELECT CURRVAL('public.photos_id_seq'); UPDATE "photo_albums" SET "preview_id" = 1 WHERE "id" = 1; COMMIT; -SELECT "photos".* FROM "photos" AS "photos" WHERE "photos"."id" = 1; +SELECT "photos".* FROM "photos" AS "photos" WHERE "photos"."id" = 1 LIMIT 1; SELECT "photo_albums".* FROM "photo_albums" AS "photo_albums" WHERE "photo_albums"."preview_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testRemove.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testRemove.sql index e77ddc6bd..ccdba335f 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testRemove.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testRemove.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "eans" ("code", "type") VALUES ('1234', 2); SELECT CURRVAL('public.eans_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testUpdateRelationship.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testUpdateRelationship.sql index 7260bba44..4a502f95e 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testUpdateRelationship.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testUpdateRelationship.sql @@ -1,2 +1,2 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testUpdateRelationshipWithNULL.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testUpdateRelationshipWithNULL.sql index 7260bba44..4a502f95e 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testUpdateRelationshipWithNULL.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipOneHasOneTest_testUpdateRelationshipWithNULL.sql @@ -1,2 +1,2 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testFindBy.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testFindBy.sql index d8dc14f4b..802ceba8f 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testFindBy.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testFindBy.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE ("books"."publisher_id" = 1) AND ("books"."author_id" IN (1)) ORDER BY "books"."id" DESC; SELECT "author_id", COUNT(DISTINCT "books"."id") as "count" FROM "books" AS "books" WHERE ("books"."publisher_id" = 1) AND ("books"."author_id" IN (1)) GROUP BY "author_id"; SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testFindByRemove.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testFindByRemove.sql index 3de5036e8..defd6d120 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testFindByRemove.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testFindByRemove.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE ("books"."id" NOT IN (3)) AND ("books"."translator_id" IN (2)); SELECT "books".* FROM "books" AS "books" WHERE ("books"."id" NOT IN (3)) AND ("books"."translator_id" IN (2)) ORDER BY "books"."id" ASC LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testGetBy.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testGetBy.sql index c12b519b2..6949ebf8c 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testGetBy.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testGetBy.sql @@ -1,3 +1,3 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testSelect.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testSelect.sql index 091cf57ff..bef5c8c84 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testSelect.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsHasManyCollectionTest_testSelect.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; SELECT "author_id", COUNT(DISTINCT "books"."id") as "count" FROM "books" AS "books" WHERE "books"."author_id" IN (1) GROUP BY "author_id"; START TRANSACTION; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddA.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddA.sql index a7764d402..1c23dc4a9 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddA.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddA.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "tags" ("name", "is_global") VALUES ('New Tag #1', 'y'); SELECT CURRVAL('public.tags_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddB.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddB.sql index b537620fb..58c56c708 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddB.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddB.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books_x_tags"."tag_id", "books_x_tags"."book_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddC.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddC.sql index b537620fb..58c56c708 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddC.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddC.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books_x_tags"."tag_id", "books_x_tags"."book_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddD.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddD.sql index 4ad56fa88..1d435f78d 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddD.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddD.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "tags" ("name", "is_global") VALUES ('New Tag #1', 'y'); SELECT CURRVAL('public.tags_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddE.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddE.sql index 4ad56fa88..1d435f78d 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddE.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddE.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "tags" ("name", "is_global") VALUES ('New Tag #1', 'y'); SELECT CURRVAL('public.tags_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddF.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddF.sql index aa6a82d11..4ec933e6d 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddF.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddF.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "tags" ("name", "is_global") VALUES ('New Tag #1', 'y'); SELECT CURRVAL('public.tags_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddH.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddH.sql index 981eb8372..4d79a178c 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddH.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddH.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books_x_tags"."tag_id", "books_x_tags"."book_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddI.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddI.sql index ef31fb7d5..f35f2ce0a 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddI.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testAddI.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books_x_tags"."tag_id", "books_x_tags"."book_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchDerivedCollectionA.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchDerivedCollectionA.sql index b4df7ea1b..181f960da 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchDerivedCollectionA.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchDerivedCollectionA.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books_x_tags"."tag_id", "books_x_tags"."book_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchDerivedCollectionB.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchDerivedCollectionB.sql index 30e5cd7d6..7f72243a2 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchDerivedCollectionB.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchDerivedCollectionB.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; ( SELECT "books_x_tags"."tag_id", diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchExistingA.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchExistingA.sql index 3b9fad123..ca1a7d7c7 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchExistingA.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testFetchExistingA.sql @@ -1,5 +1,5 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1 LIMIT 1; SELECT "books_x_tags"."book_id", "books_x_tags"."tag_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testRemoveA.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testRemoveA.sql index 82fa776b5..6af8989d0 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testRemoveA.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testRemoveA.sql @@ -1,5 +1,5 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2 LIMIT 1; SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE "tag_followers"."tag_id" IN (2); SELECT "books_x_tags"."book_id", diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testRemoveB.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testRemoveB.sql index ee2a6fd78..e36f3f841 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testRemoveB.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsManyHasManyCollectionTest_testRemoveB.sql @@ -1,7 +1,7 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3; -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3 LIMIT 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 1 LIMIT 1; SELECT "books_x_tags"."book_id", "books_x_tags"."tag_id" diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddA.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddA.sql index 2f6b8c4b1..84d4b1150 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddA.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddA.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('New Book #1', 1, NULL, NULL, NULL, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); SELECT CURRVAL('public.books_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddB.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddB.sql index 137fcd9e6..b1378ab4a 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddB.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddB.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('New Book #1', 1, NULL, NULL, NULL, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddC.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddC.sql index 137fcd9e6..b1378ab4a 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddC.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddC.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('New Book #1', 1, NULL, NULL, NULL, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddD.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddD.sql index e967c14a0..a29ddab00 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddD.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddD.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('New Book #1', 1, NULL, NULL, NULL, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); SELECT CURRVAL('public.books_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddE.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddE.sql index e967c14a0..a29ddab00 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddE.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddE.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('New Book #1', 1, NULL, NULL, NULL, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); SELECT CURRVAL('public.books_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddF.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddF.sql index 2904a5f1b..798935251 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddF.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddF.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('New Book #1', 1, NULL, NULL, NULL, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); SELECT CURRVAL('public.books_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddH.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddH.sql index 39761e818..1e79414be 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddH.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddH.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('New Book #1', 1, NULL, NULL, NULL, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddI.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddI.sql index 860d6abfe..cc43537f9 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddI.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testAddI.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('New Book #1', 1, NULL, NULL, NULL, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchDerivedCollectionA.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchDerivedCollectionA.sql index 5b0f0dc0a..17e4154ca 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchDerivedCollectionA.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchDerivedCollectionA.sql @@ -1,4 +1,4 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchDerivedCollectionB.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchDerivedCollectionB.sql index 5fa88da65..6238e1b01 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchDerivedCollectionB.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchDerivedCollectionB.sql @@ -1,4 +1,4 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC LIMIT 1; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchExistingA.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchExistingA.sql index dc6ad70b9..3cbb9ae48 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchExistingA.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testFetchExistingA.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testReAdd.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testReAdd.sql index 5b0f0dc0a..17e4154ca 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testReAdd.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testReAdd.sql @@ -1,4 +1,4 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveA.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveA.sql index 5cef2709f..ed9280aab 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveA.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveA.sql @@ -1,6 +1,6 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (1) ORDER BY "books"."id" DESC; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "books".* FROM "books" AS "books" WHERE ("books"."id" NOT IN (1)) AND ("books"."author_id" IN (1)) ORDER BY "books"."id" DESC; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveB.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveB.sql index 2e48e958c..c9c76fc65 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveB.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveB.sql @@ -1,7 +1,7 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2 LIMIT 1; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "books_x_tags"."tag_id", diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveC.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveC.sql index 2e48e958c..c9c76fc65 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveC.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveC.sql @@ -1,7 +1,7 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 2 LIMIT 1; SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" IN (1); SELECT "books_x_tags"."tag_id", diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveD.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveD.sql index de81e77b5..1c8269190 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveD.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyCollectionTest_testRemoveD.sql @@ -1,5 +1,5 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."translator_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyPersistenceTest_testCollectionCount.sql b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyPersistenceTest_testCollectionCount.sql index 996f86efa..8cb2e93de 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyPersistenceTest_testCollectionCount.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Relationships/RelationshipsOneHasManyPersistenceTest_testCollectionCount.sql @@ -1,5 +1,5 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "tags".* FROM "tags" AS "tags" WHERE "tags"."id" = 2 LIMIT 1; SELECT "books_x_tags"."book_id", "books_x_tags"."tag_id" @@ -12,7 +12,7 @@ WHERE "books_x_tags"."tag_id" IN (2); SELECT "books".* FROM "books" AS "books" WHERE "books"."id" IN (1, 2); -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; START TRANSACTION; UPDATE "books" SET "author_id" = 2 WHERE "id" = 1; UPDATE "books" SET "author_id" = 2 WHERE "id" = 2; diff --git a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testBasicCascadeRemove.sql b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testBasicCascadeRemove.sql index 6f34d16b3..e450bfc58 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testBasicCascadeRemove.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testBasicCascadeRemove.sql @@ -1,11 +1,11 @@ -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2; -SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1; -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 2 LIMIT 1; +SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."id" = 1 LIMIT 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "books" ("title", "author_id", "translator_id", "next_part", "ean_id", "publisher_id", "genre", "published_at", "printed_at", "thread_id", "price", "price_currency", "orig_price_cents", "orig_price_currency") VALUES ('Book 5', 1, 2, NULL, NULL, 1, 'fantasy', '2021-12-31 23:59:59.000000'::timestamp, NULL, NULL, NULL, NULL, NULL, NULL); SELECT CURRVAL('public.books_id_seq'); COMMIT; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 3 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."author_id" IN (2) ORDER BY "books"."id" DESC; SELECT "tag_followers".* FROM "tag_followers" AS "tag_followers" WHERE "tag_followers"."author_id" IN (2); SELECT "authors".* FROM "public"."authors" AS "authors" WHERE "authors"."favorite_author_id" IN (2); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testForeignKeyConstraintRemove.sql b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testForeignKeyConstraintRemove.sql index e43ac424e..131b6b20d 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testForeignKeyConstraintRemove.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testForeignKeyConstraintRemove.sql @@ -1,2 +1,2 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; SELECT "books".* FROM "books" AS "books" WHERE "books"."publisher_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testSingleTableInheritance.sql b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testSingleTableInheritance.sql index 8b6976085..22cae0d0e 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testSingleTableInheritance.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryCascadeRemoveTest_testSingleTableInheritance.sql @@ -1,4 +1,4 @@ -SELECT "contents".* FROM "contents" AS "contents" WHERE "contents"."id" = 2; +SELECT "contents".* FROM "contents" AS "contents" WHERE "contents"."id" = 2 LIMIT 1; SELECT "contents".* FROM "contents" AS "contents" WHERE "contents"."id" IN (1); SELECT "contents".* FROM "contents" AS "contents" WHERE "contents"."thread_id" IN (1); SELECT "books".* FROM "books" AS "books" WHERE "books"."thread_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryIdentityMapTest_testPersistence.sql b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryIdentityMapTest_testPersistence.sql index 850c87095..79a45edbe 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryIdentityMapTest_testPersistence.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryIdentityMapTest_testPersistence.sql @@ -1,4 +1,4 @@ -SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1; +SELECT "publishers".* FROM "publishers" AS "publishers" WHERE "publishers"."publisher_id" = 1 LIMIT 1; START TRANSACTION; INSERT INTO "public"."authors" ("name", "born_on", "web", "favorite_author_id") VALUES ('A', '2021-03-21'::date, 'http://www.example.com', NULL); SELECT CURRVAL('public.authors_id_seq'); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositorySTITest_testSelect.sql b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositorySTITest_testSelect.sql index 786819077..c58498e0c 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositorySTITest_testSelect.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositorySTITest_testSelect.sql @@ -1,2 +1,2 @@ -SELECT "contents".* FROM "contents" AS "contents" WHERE "contents"."id" = 1; +SELECT "contents".* FROM "contents" AS "contents" WHERE "contents"."id" = 1 LIMIT 1; SELECT "contents".* FROM "contents" AS "contents" WHERE "contents"."thread_id" IN (1); diff --git a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryTest_testNonNullable.sql b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryTest_testNonNullable.sql index 6b4734ba4..855d8addc 100644 --- a/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryTest_testNonNullable.sql +++ b/tests/sqls/NextrasTests/Orm/Integration/Repository/RepositoryTest_testNonNullable.sql @@ -1,4 +1,4 @@ -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 923; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 923; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; -SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 923 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 923 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1; +SELECT "books".* FROM "books" AS "books" WHERE "books"."id" = 1 LIMIT 1;