diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 95b9707..d7dc56f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,16 +23,16 @@ jobs: - 3306:3306 options: --health-cmd="healthcheck.sh --su-mysql --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 - name: PHP 8.3 - MariaDB + name: PHP 8.5 - MariaDB steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.5 ini-values: mysqli.allow_local_infile=On tools: composer coverage: xdebug @@ -91,7 +91,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -124,16 +124,16 @@ jobs: - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - name: PHP 8.3 - MySQL + name: PHP 8.5 - MySQL steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.5 ini-values: mysqli.allow_local_infile=On tools: composer coverage: xdebug @@ -166,7 +166,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 923965f..4f21049 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ --- -image: registry.gitlab.com/aplus-framework/images/base:4 +image: registry.gitlab.com/aplus-framework/images/base:6 include: - template: Security/SAST.gitlab-ci.yml diff --git a/composer.json b/composer.json index 1f0e0fa..f69c997 100644 --- a/composer.json +++ b/composer.json @@ -33,14 +33,14 @@ } ], "require": { - "php": ">=8.3", + "php": ">=8.5", "ext-mysqli": "*", - "aplus/debug": "^4.3", - "aplus/log": "^4.0" + "aplus/debug": "^5.0", + "aplus/log": "^5.0" }, "require-dev": { "ext-xdebug": "*", - "aplus/coding-standard": "^2.8", + "aplus/coding-standard": "^3.0", "ergebnis/composer-normalize": "^2.25", "jetbrains/phpstorm-attributes": "^1.0", "phpmd/phpmd": "^2.13", diff --git a/docker-compose.yml b/docker-compose.yml index a2c9f98..f5b73ed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ -version: "3" services: package: - image: registry.gitlab.com/aplus-framework/images/package:4 + image: registry.gitlab.com/aplus-framework/images/package:6 container_name: package-database working_dir: /package volumes: diff --git a/src/Database.php b/src/Database.php index 6afcca6..d5c869b 100644 --- a/src/Database.php +++ b/src/Database.php @@ -25,6 +25,7 @@ use Framework\Database\Manipulation\Select; use Framework\Database\Manipulation\Update; use Framework\Database\Manipulation\With; +use Framework\Database\Result\Result; use Framework\Log\Logger; use Framework\Log\LogLevel; use InvalidArgumentException; @@ -318,20 +319,6 @@ public function close() : bool return $closed; } - /** - * Pings the server, or tries to reconnect if the connection has gone down. - * - * @return bool - * - * @deprecated - * - * @codeCoverageIgnore - */ - public function ping() : bool - { - return $this->mysqli->ping(); - } - /** * Closes the current and opens a new connection with the last config. * @@ -750,7 +737,7 @@ public function getInsertId() : int | string * * @param string $identifier * - * @see https://mariadb.com/kb/en/identifier-names/ + * @see https://mariadb.com/docs/server/reference/sql-structure/sql-language-structure/identifier-names * * @return string */ @@ -769,7 +756,7 @@ public function protectIdentifier(string $identifier) : string * * @param bool|float|int|string|null $value Value to be quoted * - * @see https://mariadb.com/kb/en/quote/ + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/quote * * @throws InvalidArgumentException For invalid value type * diff --git a/src/Definition/AlterSchema.php b/src/Definition/AlterSchema.php index d22fb3c..2c2490d 100644 --- a/src/Definition/AlterSchema.php +++ b/src/Definition/AlterSchema.php @@ -15,7 +15,7 @@ /** * Class AlterSchema. * - * @see https://mariadb.com/kb/en/alter-database/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-database * * @package database */ diff --git a/src/Definition/AlterTable.php b/src/Definition/AlterTable.php index b254001..3e6fd15 100644 --- a/src/Definition/AlterTable.php +++ b/src/Definition/AlterTable.php @@ -17,7 +17,7 @@ /** * Class AlterTable. * - * @see https://mariadb.com/kb/en/alter-table/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table * * @package database */ @@ -559,7 +559,7 @@ protected function renderCollate() : ?string /** * @param string $type * - * @see https://mariadb.com/kb/en/alter-table/#lock + * @see https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-table#lock * @see AlterTable::LOCK_DEFAULT * @see AlterTable::LOCK_EXCLUSIVE * @see AlterTable::LOCK_NONE @@ -607,7 +607,7 @@ protected function renderForce() : ?string /** * @param string $algo * - * @see https://mariadb.com/kb/en/innodb-online-ddl-overview/#algorithm + * @see https://mariadb.com/docs/server/server-usage/storage-engines/innodb/innodb-online-ddl/innodb-online-ddl-overview#algorithm#alter-algorithms * @see AlterTable::ALGO_COPY * @see AlterTable::ALGO_DEFAULT * @see AlterTable::ALGO_INPLACE diff --git a/src/Definition/CreateSchema.php b/src/Definition/CreateSchema.php index 92a8d71..013d46f 100644 --- a/src/Definition/CreateSchema.php +++ b/src/Definition/CreateSchema.php @@ -15,7 +15,7 @@ /** * Class CreateSchema. * - * @see https://mariadb.com/kb/en/create-database/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-database * * @package database */ diff --git a/src/Definition/CreateTable.php b/src/Definition/CreateTable.php index 3afa68e..62b2aa8 100644 --- a/src/Definition/CreateTable.php +++ b/src/Definition/CreateTable.php @@ -16,7 +16,7 @@ /** * Class CreateTable. * - * @see https://mariadb.com/kb/en/create-table/ + * @see https://mariadb.com/docs/server/server-usage/tables/create-table * * @package database */ diff --git a/src/Definition/DropSchema.php b/src/Definition/DropSchema.php index 4c38642..11f8708 100644 --- a/src/Definition/DropSchema.php +++ b/src/Definition/DropSchema.php @@ -15,7 +15,7 @@ /** * Class DropSchema. * - * @see https://mariadb.com/kb/en/drop-database/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-database * * @package database */ diff --git a/src/Definition/DropTable.php b/src/Definition/DropTable.php index 2760b9e..bfece39 100644 --- a/src/Definition/DropTable.php +++ b/src/Definition/DropTable.php @@ -16,7 +16,7 @@ /** * Class DropTable. * - * @see https://mariadb.com/kb/en/drop-table/ + * @see https://mariadb.com/docs/server/server-usage/tables/drop-table * * @package database */ diff --git a/src/Definition/Table/Check.php b/src/Definition/Table/Check.php index 7c876a8..33305c6 100644 --- a/src/Definition/Table/Check.php +++ b/src/Definition/Table/Check.php @@ -15,7 +15,7 @@ /** * Class Check. * - * @see https://mariadb.com/kb/en/constraint/#check-constraints + * @see https://mariadb.com/docs/server/reference/sql-statements/data-definition/constraint#check-constraints * * @package database */ diff --git a/src/Definition/Table/Columns/ColumnDefinition.php b/src/Definition/Table/Columns/ColumnDefinition.php index 8930d70..9526159 100644 --- a/src/Definition/Table/Columns/ColumnDefinition.php +++ b/src/Definition/Table/Columns/ColumnDefinition.php @@ -52,7 +52,7 @@ /** * Class ColumnDefinition. * - * @see https://mariadb.com/kb/en/create-table/#index-definitions + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#index-definitions * * @package database */ diff --git a/src/Definition/Table/Columns/DateTime/DateColumn.php b/src/Definition/Table/Columns/DateTime/DateColumn.php index 3fba5b2..47a4e0f 100644 --- a/src/Definition/Table/Columns/DateTime/DateColumn.php +++ b/src/Definition/Table/Columns/DateTime/DateColumn.php @@ -14,7 +14,7 @@ /** * Class EnumColumn. * - * @see https://mariadb.com/kb/en/date/ + * @see https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/date * * @package database */ diff --git a/src/Definition/Table/Columns/DateTime/DatetimeColumn.php b/src/Definition/Table/Columns/DateTime/DatetimeColumn.php index 161f44c..379fab8 100644 --- a/src/Definition/Table/Columns/DateTime/DatetimeColumn.php +++ b/src/Definition/Table/Columns/DateTime/DatetimeColumn.php @@ -14,7 +14,7 @@ /** * Class DatetimeColumn. * - * @see https://mariadb.com/kb/en/datetime/ + * @see https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/datetime * * @package database */ diff --git a/src/Definition/Table/Columns/DateTime/TimeColumn.php b/src/Definition/Table/Columns/DateTime/TimeColumn.php index f3e67b5..b54d097 100644 --- a/src/Definition/Table/Columns/DateTime/TimeColumn.php +++ b/src/Definition/Table/Columns/DateTime/TimeColumn.php @@ -14,7 +14,7 @@ /** * Class TimeColumn. * - * @see https://mariadb.com/kb/en/time/ + * @see https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/time * * @package database */ diff --git a/src/Definition/Table/Columns/DateTime/TimestampColumn.php b/src/Definition/Table/Columns/DateTime/TimestampColumn.php index f4ecff0..4216130 100644 --- a/src/Definition/Table/Columns/DateTime/TimestampColumn.php +++ b/src/Definition/Table/Columns/DateTime/TimestampColumn.php @@ -14,7 +14,7 @@ /** * Class TimestampColumn. * - * @see https://mariadb.com/kb/en/timestamp/ + * @see https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/timestamp * * @package database */ diff --git a/src/Definition/Table/Columns/DateTime/YearColumn.php b/src/Definition/Table/Columns/DateTime/YearColumn.php index 9ef1426..9b01a6d 100644 --- a/src/Definition/Table/Columns/DateTime/YearColumn.php +++ b/src/Definition/Table/Columns/DateTime/YearColumn.php @@ -14,7 +14,7 @@ /** * Class YearColumn. * - * @see https://mariadb.com/kb/en/year-data-type/ + * @see https://mariadb.com/docs/server/reference/data-types/date-and-time-data-types/year-data-type * * @package database */ diff --git a/src/Definition/Table/Columns/Geometry/GeometryCollectionColumn.php b/src/Definition/Table/Columns/Geometry/GeometryCollectionColumn.php index 7d9cab4..9e4581c 100644 --- a/src/Definition/Table/Columns/Geometry/GeometryCollectionColumn.php +++ b/src/Definition/Table/Columns/Geometry/GeometryCollectionColumn.php @@ -14,7 +14,7 @@ /** * Class GeometryCollectionColumn. * - * @see https://mariadb.com/kb/en/geometrycollection/ + * @see https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-constructors/geometrycollection * * @package database */ diff --git a/src/Definition/Table/Columns/Geometry/GeometryColumn.php b/src/Definition/Table/Columns/Geometry/GeometryColumn.php index 3033ecd..01c4a5f 100644 --- a/src/Definition/Table/Columns/Geometry/GeometryColumn.php +++ b/src/Definition/Table/Columns/Geometry/GeometryColumn.php @@ -14,7 +14,7 @@ /** * Class GeometryColumn. * - * @see https://mariadb.com/kb/en/geometry/ + * @see https://mariadb.com/docs/server/reference/sql-structure/geometry/geometry-types#geometry * * @package database */ diff --git a/src/Definition/Table/Columns/Geometry/LinestringColumn.php b/src/Definition/Table/Columns/Geometry/LinestringColumn.php index 6a2c6f6..9fb8a39 100644 --- a/src/Definition/Table/Columns/Geometry/LinestringColumn.php +++ b/src/Definition/Table/Columns/Geometry/LinestringColumn.php @@ -14,7 +14,7 @@ /** * Class LinestringColumn. * - * @see https://mariadb.com/kb/en/linestring/ + * @see https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-constructors/linestring * * @package database */ diff --git a/src/Definition/Table/Columns/Geometry/MultilinestringColumn.php b/src/Definition/Table/Columns/Geometry/MultilinestringColumn.php index 7fc0f3b..9901939 100644 --- a/src/Definition/Table/Columns/Geometry/MultilinestringColumn.php +++ b/src/Definition/Table/Columns/Geometry/MultilinestringColumn.php @@ -14,7 +14,7 @@ /** * Class MultilinestringColumn. * - * @see https://mariadb.com/kb/en/multilinestring/ + * @see https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-constructors/multilinestring * * @package database */ diff --git a/src/Definition/Table/Columns/Geometry/MultipointColumn.php b/src/Definition/Table/Columns/Geometry/MultipointColumn.php index 2945879..5d9d658 100644 --- a/src/Definition/Table/Columns/Geometry/MultipointColumn.php +++ b/src/Definition/Table/Columns/Geometry/MultipointColumn.php @@ -14,7 +14,7 @@ /** * Class MultipointColumn. * - * @see https://mariadb.com/kb/en/multipoint/ + * @see https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-constructors/multipoint * * @package database */ diff --git a/src/Definition/Table/Columns/Geometry/MultipolygonColumn.php b/src/Definition/Table/Columns/Geometry/MultipolygonColumn.php index 2f3b2cd..b77ed2d 100644 --- a/src/Definition/Table/Columns/Geometry/MultipolygonColumn.php +++ b/src/Definition/Table/Columns/Geometry/MultipolygonColumn.php @@ -14,7 +14,7 @@ /** * Class MultipolygonColumn. * - * @see https://mariadb.com/kb/en/multipolygon/ + * @see https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-constructors/multipolygon * * @package database */ diff --git a/src/Definition/Table/Columns/Geometry/PointColumn.php b/src/Definition/Table/Columns/Geometry/PointColumn.php index 6a039cd..de7d386 100644 --- a/src/Definition/Table/Columns/Geometry/PointColumn.php +++ b/src/Definition/Table/Columns/Geometry/PointColumn.php @@ -14,7 +14,7 @@ /** * Class PointColumn. * - * @see https://mariadb.com/kb/en/point/ + * @see https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-constructors/point * * @package database */ diff --git a/src/Definition/Table/Columns/Geometry/PolygonColumn.php b/src/Definition/Table/Columns/Geometry/PolygonColumn.php index a540d31..550a238 100644 --- a/src/Definition/Table/Columns/Geometry/PolygonColumn.php +++ b/src/Definition/Table/Columns/Geometry/PolygonColumn.php @@ -14,7 +14,7 @@ /** * Class PolygonColumn. * - * @see https://mariadb.com/kb/en/polygon/ + * @see https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-constructors/polygon * * @package database */ diff --git a/src/Definition/Table/Columns/Numeric/BitColumn.php b/src/Definition/Table/Columns/Numeric/BitColumn.php index 641a65f..75b78f3 100644 --- a/src/Definition/Table/Columns/Numeric/BitColumn.php +++ b/src/Definition/Table/Columns/Numeric/BitColumn.php @@ -14,7 +14,7 @@ /** * Class BitColumn. * - * @see https://mariadb.com/kb/en/bit/ + * @see https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bit * * @package database */ diff --git a/src/Definition/Table/Columns/Numeric/BooleanColumn.php b/src/Definition/Table/Columns/Numeric/BooleanColumn.php index 881899e..6e28722 100644 --- a/src/Definition/Table/Columns/Numeric/BooleanColumn.php +++ b/src/Definition/Table/Columns/Numeric/BooleanColumn.php @@ -12,7 +12,7 @@ /** * Class BooleanColumn. * - * @see https://mariadb.com/kb/en/boolean/ + * @see https://mariadb.com/docs/server/reference/data-types/numeric-data-types/boolean * * @package database */ diff --git a/src/Definition/Table/Columns/Numeric/MediumintColumn.php b/src/Definition/Table/Columns/Numeric/MediumintColumn.php index 115c290..ce5a225 100644 --- a/src/Definition/Table/Columns/Numeric/MediumintColumn.php +++ b/src/Definition/Table/Columns/Numeric/MediumintColumn.php @@ -12,7 +12,7 @@ /** * Class MediumintColumn. * - * @see https://mariadb.com/kb/en/mediumint/ + * @see https://mariadb.com/docs/server/reference/data-types/numeric-data-types/mediumint * * @package database */ diff --git a/src/Definition/Table/Columns/Numeric/NumericDataType.php b/src/Definition/Table/Columns/Numeric/NumericDataType.php index 498449c..f590b3d 100644 --- a/src/Definition/Table/Columns/Numeric/NumericDataType.php +++ b/src/Definition/Table/Columns/Numeric/NumericDataType.php @@ -24,7 +24,7 @@ abstract class NumericDataType extends Column protected bool $autoIncrement = false; /** - * @see https://mariadb.com/kb/en/auto_increment/ + * @see https://mariadb.com/docs/server/reference/data-types/auto_increment * * @return static */ diff --git a/src/Definition/Table/Columns/Numeric/SmallintColumn.php b/src/Definition/Table/Columns/Numeric/SmallintColumn.php index cf90cc6..f99b6af 100644 --- a/src/Definition/Table/Columns/Numeric/SmallintColumn.php +++ b/src/Definition/Table/Columns/Numeric/SmallintColumn.php @@ -12,7 +12,7 @@ /** * Class SmallintColumn. * - * @see https://mariadb.com/kb/en/smallint/ + * @see https://mariadb.com/docs/server/reference/data-types/numeric-data-types/smallint * * @package database */ diff --git a/src/Definition/Table/Columns/String/BinaryColumn.php b/src/Definition/Table/Columns/String/BinaryColumn.php index 91b2556..a5b9472 100644 --- a/src/Definition/Table/Columns/String/BinaryColumn.php +++ b/src/Definition/Table/Columns/String/BinaryColumn.php @@ -14,7 +14,7 @@ /** * Class BinaryColumn. * - * @see https://mariadb.com/kb/en/binary/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/binary * * @package database */ diff --git a/src/Definition/Table/Columns/String/BlobColumn.php b/src/Definition/Table/Columns/String/BlobColumn.php index e4f408e..0187066 100644 --- a/src/Definition/Table/Columns/String/BlobColumn.php +++ b/src/Definition/Table/Columns/String/BlobColumn.php @@ -14,7 +14,7 @@ /** * Class BlobColumn. * - * @see https://mariadb.com/kb/en/blob/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/blob * * @package database */ diff --git a/src/Definition/Table/Columns/String/CharColumn.php b/src/Definition/Table/Columns/String/CharColumn.php index dc4c9dd..e09a70d 100644 --- a/src/Definition/Table/Columns/String/CharColumn.php +++ b/src/Definition/Table/Columns/String/CharColumn.php @@ -12,7 +12,7 @@ /** * Class CharColumn. * - * @see https://mariadb.com/kb/en/char/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/char * * @package database */ diff --git a/src/Definition/Table/Columns/String/EnumColumn.php b/src/Definition/Table/Columns/String/EnumColumn.php index ed082a4..e5f067b 100644 --- a/src/Definition/Table/Columns/String/EnumColumn.php +++ b/src/Definition/Table/Columns/String/EnumColumn.php @@ -14,7 +14,7 @@ /** * Class EnumColumn. * - * @see https://mariadb.com/kb/en/enum/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/enum * * @package database */ diff --git a/src/Definition/Table/Columns/String/JsonColumn.php b/src/Definition/Table/Columns/String/JsonColumn.php index d2c5e9b..c6348ed 100644 --- a/src/Definition/Table/Columns/String/JsonColumn.php +++ b/src/Definition/Table/Columns/String/JsonColumn.php @@ -12,7 +12,7 @@ /** * Class JsonColumn. * - * @see https://mariadb.com/kb/en/json-data-type/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/json * * @package database */ diff --git a/src/Definition/Table/Columns/String/LongblobColumn.php b/src/Definition/Table/Columns/String/LongblobColumn.php index 1fea5ec..8e5d196 100644 --- a/src/Definition/Table/Columns/String/LongblobColumn.php +++ b/src/Definition/Table/Columns/String/LongblobColumn.php @@ -14,7 +14,7 @@ /** * Class LongblobColumn. * - * @see https://mariadb.com/kb/en/longblob/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/longblob * * @package database */ diff --git a/src/Definition/Table/Columns/String/LongtextColumn.php b/src/Definition/Table/Columns/String/LongtextColumn.php index 630d42b..c60ff5c 100644 --- a/src/Definition/Table/Columns/String/LongtextColumn.php +++ b/src/Definition/Table/Columns/String/LongtextColumn.php @@ -12,7 +12,7 @@ /** * Class LongtextColumn. * - * @see https://mariadb.com/kb/en/longtext/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/longtext * * @package database */ diff --git a/src/Definition/Table/Columns/String/MediumblobColumn.php b/src/Definition/Table/Columns/String/MediumblobColumn.php index 7c6f2c0..8ae7247 100644 --- a/src/Definition/Table/Columns/String/MediumblobColumn.php +++ b/src/Definition/Table/Columns/String/MediumblobColumn.php @@ -14,7 +14,7 @@ /** * Class MediumblobColumn. * - * @see https://mariadb.com/kb/en/mediumblob/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/mediumblob * * @package database */ diff --git a/src/Definition/Table/Columns/String/MediumtextColumn.php b/src/Definition/Table/Columns/String/MediumtextColumn.php index 8e61ecd..6dfa528 100644 --- a/src/Definition/Table/Columns/String/MediumtextColumn.php +++ b/src/Definition/Table/Columns/String/MediumtextColumn.php @@ -12,7 +12,7 @@ /** * Class MediumtextColumn. * - * @see https://mariadb.com/kb/en/mediumtext/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/mediumtext * * @package database */ diff --git a/src/Definition/Table/Columns/String/SetColumn.php b/src/Definition/Table/Columns/String/SetColumn.php index c45bb9b..56ca04c 100644 --- a/src/Definition/Table/Columns/String/SetColumn.php +++ b/src/Definition/Table/Columns/String/SetColumn.php @@ -14,7 +14,7 @@ /** * Class SetColumn. * - * @see https://mariadb.com/kb/en/set-data-type/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/set-data-type * * @package database */ diff --git a/src/Definition/Table/Columns/String/TextColumn.php b/src/Definition/Table/Columns/String/TextColumn.php index e1b663e..2561d3e 100644 --- a/src/Definition/Table/Columns/String/TextColumn.php +++ b/src/Definition/Table/Columns/String/TextColumn.php @@ -12,7 +12,7 @@ /** * Class TextColumn. * - * @see https://mariadb.com/kb/en/text/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/text * * @package database */ diff --git a/src/Definition/Table/Columns/String/TinyblobColumn.php b/src/Definition/Table/Columns/String/TinyblobColumn.php index d229cf5..82c91da 100644 --- a/src/Definition/Table/Columns/String/TinyblobColumn.php +++ b/src/Definition/Table/Columns/String/TinyblobColumn.php @@ -14,7 +14,7 @@ /** * Class TinyblobColumn. * - * @see https://mariadb.com/kb/en/tinyblob/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/tinyblob * * @package database */ diff --git a/src/Definition/Table/Columns/String/TinytextColumn.php b/src/Definition/Table/Columns/String/TinytextColumn.php index 6f0fec8..6cc7d98 100644 --- a/src/Definition/Table/Columns/String/TinytextColumn.php +++ b/src/Definition/Table/Columns/String/TinytextColumn.php @@ -12,7 +12,7 @@ /** * Class TinytextColumn. * - * @see https://mariadb.com/kb/en/tinytext/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/tinytext * * @package database */ diff --git a/src/Definition/Table/Columns/String/VarbinaryColumn.php b/src/Definition/Table/Columns/String/VarbinaryColumn.php index f7f1f77..fd300da 100644 --- a/src/Definition/Table/Columns/String/VarbinaryColumn.php +++ b/src/Definition/Table/Columns/String/VarbinaryColumn.php @@ -14,7 +14,7 @@ /** * Class VarbinaryColumn. * - * @see https://mariadb.com/kb/en/varbinary/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/varbinary * * @package database */ diff --git a/src/Definition/Table/Columns/String/VarcharColumn.php b/src/Definition/Table/Columns/String/VarcharColumn.php index 4b68dbd..c7266fb 100644 --- a/src/Definition/Table/Columns/String/VarcharColumn.php +++ b/src/Definition/Table/Columns/String/VarcharColumn.php @@ -12,7 +12,7 @@ /** * Class VarcharColumn. * - * @see https://mariadb.com/kb/en/varchar/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/varchar * * @package database */ diff --git a/src/Definition/Table/Indexes/Index.php b/src/Definition/Table/Indexes/Index.php index 17c283d..5254716 100644 --- a/src/Definition/Table/Indexes/Index.php +++ b/src/Definition/Table/Indexes/Index.php @@ -16,7 +16,7 @@ /** * Class Index. * - * @see https://mariadb.com/kb/en/getting-started-with-indexes/ + * @see https://mariadb.com/docs/server/mariadb-quickstart-guides/mariadb-indexes-guide * * @package database */ diff --git a/src/Definition/Table/Indexes/IndexDefinition.php b/src/Definition/Table/Indexes/IndexDefinition.php index ee43895..1cf1052 100644 --- a/src/Definition/Table/Indexes/IndexDefinition.php +++ b/src/Definition/Table/Indexes/IndexDefinition.php @@ -22,8 +22,8 @@ /** * Class IndexDefinition. * - * @see https://mariadb.com/kb/en/create-table/#index-definitions - * @see https://mariadb.com/kb/en/optimization-and-indexes/ + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#index-definitions + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes * * @package database */ diff --git a/src/Definition/Table/Indexes/Keys/ForeignKey.php b/src/Definition/Table/Indexes/Keys/ForeignKey.php index fb106e3..c3104ef 100644 --- a/src/Definition/Table/Indexes/Keys/ForeignKey.php +++ b/src/Definition/Table/Indexes/Keys/ForeignKey.php @@ -15,7 +15,7 @@ /** * Class ForeignKey. * - * @see https://mariadb.com/kb/en/foreign-keys/ + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/foreign-keys * * @package database */ diff --git a/src/Definition/Table/Indexes/Keys/FulltextKey.php b/src/Definition/Table/Indexes/Keys/FulltextKey.php index e0afd49..67b2446 100644 --- a/src/Definition/Table/Indexes/Keys/FulltextKey.php +++ b/src/Definition/Table/Indexes/Keys/FulltextKey.php @@ -14,7 +14,7 @@ /** * Class FulltextKey. * - * @see https://mariadb.com/kb/en/full-text-index-overview/ + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/full-text-indexes/full-text-index-overview * * @package database */ diff --git a/src/Definition/Table/Indexes/Keys/SpatialKey.php b/src/Definition/Table/Indexes/Keys/SpatialKey.php index de6c624..238eee9 100644 --- a/src/Definition/Table/Indexes/Keys/SpatialKey.php +++ b/src/Definition/Table/Indexes/Keys/SpatialKey.php @@ -14,7 +14,7 @@ /** * Class SpatialKey. * - * @see https://mariadb.com/kb/en/spatial-index/ + * @see https://mariadb.com/docs/server/reference/sql-structure/geometry/spatial-index * * @package database */ diff --git a/src/Definition/Table/Indexes/Keys/UniqueKey.php b/src/Definition/Table/Indexes/Keys/UniqueKey.php index c9a932a..34f853f 100644 --- a/src/Definition/Table/Indexes/Keys/UniqueKey.php +++ b/src/Definition/Table/Indexes/Keys/UniqueKey.php @@ -12,7 +12,7 @@ /** * Class UniqueKey. * - * @see https://mariadb.com/kb/en/getting-started-with-indexes/#unique-index + * @see https://mariadb.com/docs/server/mariadb-quickstart-guides/mariadb-indexes-guide#unique-index * * @package database */ diff --git a/src/Definition/Table/TableStatement.php b/src/Definition/Table/TableStatement.php index 0f083c8..ab95eee 100644 --- a/src/Definition/Table/TableStatement.php +++ b/src/Definition/Table/TableStatement.php @@ -15,138 +15,138 @@ /** * Class TableStatement. * - * @see https://mariadb.com/kb/en/create-table/#table-options + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#table-options * * @package database */ abstract class TableStatement extends Statement { /** - * @see https://mariadb.com/kb/en/create-table/#storage-engine + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#storage-engine */ public const string OPT_ENGINE = 'ENGINE'; /** - * @see https://mariadb.com/kb/en/create-table/#auto_increment + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#auto_increment */ public const string OPT_AUTO_INCREMENT = 'AUTO_INCREMENT'; /** - * @see https://mariadb.com/kb/en/create-table/#avg_row_length + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#avg_row_length */ public const string OPT_AVG_ROW_LENGTH = 'AVG_ROW_LENGTH'; /** - * @see https://mariadb.com/kb/en/create-table/#default-character-setcharset + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#default-character-set-charset */ public const string OPT_CHARSET = 'CHARSET'; /** - * @see https://mariadb.com/kb/en/create-table/#checksumtable_checksum + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#checksum-table_checksum */ public const string OPT_CHECKSUM = 'CHECKSUM'; /** - * @see https://mariadb.com/kb/en/create-table/#default-collate + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#default-collate */ public const string OPT_COLLATE = 'COLLATE'; /** - * @see https://mariadb.com/kb/en/create-table/#comment + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#comment */ public const string OPT_COMMENT = 'COMMENT'; /** - * @see https://mariadb.com/kb/en/create-table/#connection + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#connection */ public const string OPT_CONNECTION = 'CONNECTION'; /** - * @see https://mariadb.com/kb/en/create-table/#data-directoryindex-directory + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#data-directory-index-directory */ public const string OPT_DATA_DIRECTORY = 'DATA DIRECTORY'; /** - * @see https://mariadb.com/kb/en/create-table/#delay_key_write + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#delay_key_write */ public const string OPT_DELAY_KEY_WRITE = 'DELAY_KEY_WRITE'; /** - * @see https://mariadb.com/kb/en/create-table/#encrypted + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#encrypted */ public const string OPT_ENCRYPTED = 'ENCRYPTED'; /** - * @see https://mariadb.com/kb/en/create-table/#encryption_key_id + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#encryption_key_id */ public const string OPT_ENCRYPTION_KEY_ID = 'ENCRYPTION_KEY_ID'; /** - * @see https://mariadb.com/kb/en/create-table/#ietf_quotes + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#ietf_quotes */ public const string OPT_IETF_QUOTES = 'IETF_QUOTES'; /** - * @see https://mariadb.com/kb/en/create-table/#data-directoryindex-directory + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#data-directory-index-directory */ public const string OPT_INDEX_DIRECTORY = 'INDEX DIRECTORY'; /** - * @see https://mariadb.com/kb/en/create-table/#insert_method + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#insert_method */ public const string OPT_INSERT_METHOD = 'INSERT_METHOD'; /** - * @see https://mariadb.com/kb/en/create-table/#key_block_size + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#key_block_size */ public const string OPT_KEY_BLOCK_SIZE = 'KEY_BLOCK_SIZE'; /** - * @see https://mariadb.com/kb/en/create-table/#min_rowsmax_rows + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#min_rows-max_rows */ public const string OPT_MAX_ROWS = 'MAX_ROWS'; /** - * @see https://mariadb.com/kb/en/create-table/#min_rowsmax_rows + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#min_rows-max_rows */ public const string OPT_MIN_ROWS = 'MIN_ROWS'; /** - * @see https://mariadb.com/kb/en/create-table/#pack_keys + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#pack_keys */ public const string OPT_PACK_KEYS = 'PACK_KEYS'; /** - * @see https://mariadb.com/kb/en/create-table/#page_checksum + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#page_checksum */ public const string OPT_PAGE_CHECKSUM = 'PAGE_CHECKSUM'; /** - * @see https://mariadb.com/kb/en/create-table/#page_compressed + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#page_compressed */ public const string OPT_PAGE_COMPRESSED = 'PAGE_COMPRESSED'; /** - * @see https://mariadb.com/kb/en/create-table/#page_compression_level + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#page_compression_level */ public const string OPT_PAGE_COMPRESSION_LEVEL = 'PAGE_COMPRESSION_LEVEL'; /** - * @see https://mariadb.com/kb/en/create-table/#password + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#password */ public const string OPT_PASSWORD = 'PASSWORD'; /** - * @see https://mariadb.com/kb/en/create-table/#row_format + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#row_format */ public const string OPT_ROW_FORMAT = 'ROW_FORMAT'; /** - * @see https://mariadb.com/kb/en/create-table/#sequence + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#sequence */ public const string OPT_SEQUENCE = 'SEQUENCE'; /** - * @see https://mariadb.com/kb/en/create-table/#stats_auto_recalc + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#stats_auto_recalc */ public const string OPT_STATS_AUTO_RECALC = 'STATS_AUTO_RECALC'; /** - * @see https://mariadb.com/kb/en/create-table/#stats_persistent + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#stats_persistent */ public const string OPT_STATS_PERSISTENT = 'STATS_PERSISTENT'; /** - * @see https://mariadb.com/kb/en/create-table/#stats_sample_pages + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#stats_sample_pages */ public const string OPT_STATS_SAMPLE_PAGES = 'STATS_SAMPLE_PAGES'; /** - * @see https://mariadb.com/kb/en/create-tablespace/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-tablespace */ public const string OPT_TABLESPACE = 'TABLESPACE'; /** - * @see https://mariadb.com/kb/en/create-table/#transactional + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#transactional */ public const string OPT_TRANSACTIONAL = 'TRANSACTIONAL'; /** - * @see https://mariadb.com/kb/en/create-table/#union + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#union */ public const string OPT_UNION = 'UNION'; /** - * @see https://mariadb.com/kb/en/create-table/#with-system-versioning + * @see https://mariadb.com/docs/server/server-usage/tables/create-table#with-system-versioning */ public const string OPT_WITH_SYSTEM_VERSIONING = 'WITH SYSTEM VERSIONING'; diff --git a/src/Manipulation/Delete.php b/src/Manipulation/Delete.php index 59c591c..4f08708 100644 --- a/src/Manipulation/Delete.php +++ b/src/Manipulation/Delete.php @@ -15,7 +15,7 @@ /** * Class Delete. * - * @see https://mariadb.com/kb/en/delete/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/delete * * @package database */ @@ -96,7 +96,7 @@ protected function renderTable() : ?string * * @param int $limit * - * @see https://mariadb.com/kb/en/limit/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/limit * * @return static */ diff --git a/src/Manipulation/Insert.php b/src/Manipulation/Insert.php index babaeb5..c4d2596 100644 --- a/src/Manipulation/Insert.php +++ b/src/Manipulation/Insert.php @@ -16,7 +16,7 @@ /** * Class Insert. * - * @see https://mariadb.com/kb/en/insert/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert * * @package database */ @@ -27,21 +27,21 @@ class Insert extends Statement use Traits\Values; /** - * @see https://mariadb.com/kb/en/insert-delayed/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert-delayed */ public const string OPT_DELAYED = 'DELAYED'; /** * Convert errors to warnings, which will not stop inserts of additional rows. * - * @see https://mariadb.com/kb/en/insert-ignore/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert-ignore */ public const string OPT_IGNORE = 'IGNORE'; /** - * @see https://mariadb.com/kb/en/high_priority-and-low_priority/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/high_priority-and-low_priority */ public const string OPT_HIGH_PRIORITY = 'HIGH_PRIORITY'; /** - * @see https://mariadb.com/kb/en/high_priority-and-low_priority/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/high_priority-and-low_priority */ public const string OPT_LOW_PRIORITY = 'LOW_PRIORITY'; @@ -143,7 +143,7 @@ protected function renderColumns() : ?string * @param array|object $columns Column name * as key/property, column value/expression as value * - * @see https://mariadb.com/kb/en/insert-on-duplicate-key-update/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert-on-duplicate-key-update * * @return static */ diff --git a/src/Manipulation/LoadData.php b/src/Manipulation/LoadData.php index a9cdde8..36d7732 100644 --- a/src/Manipulation/LoadData.php +++ b/src/Manipulation/LoadData.php @@ -15,7 +15,7 @@ /** * Class LoadData. * - * @see https://mariadb.com/kb/en/load-data-infile/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/load-data-into-tables-or-index/load-data-infile * * @package database */ @@ -24,15 +24,15 @@ class LoadData extends Statement use Traits\Set; /** - * @see https://mariadb.com/kb/en/high_priority-and-low_priority/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/high_priority-and-low_priority */ public const string OPT_LOW_PRIORITY = 'LOW_PRIORITY'; /** - * @see https://mariadb.com/kb/en/load-data-infile/#priority-and-concurrency + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/load-data-into-tables-or-index/load-data-infile#priority-and-concurrency */ public const string OPT_CONCURRENT = 'CONCURRENT'; /** - * @see https://mariadb.com/kb/en/load-data-infile/#load-data-local-infile + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/load-data-into-tables-or-index/load-data-infile#load-data-local-infile */ public const string OPT_LOCAL = 'LOCAL'; @@ -106,7 +106,7 @@ protected function renderIntoTable() : string /** * @param string $charset * - * @see https://mariadb.com/kb/en/supported-character-sets-and-collations/ + * @see https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/supported-character-sets-and-collations * * @return static */ diff --git a/src/Manipulation/Replace.php b/src/Manipulation/Replace.php index fb53287..4cb6d53 100644 --- a/src/Manipulation/Replace.php +++ b/src/Manipulation/Replace.php @@ -15,7 +15,7 @@ /** * Class Replace. * - * @see https://mariadb.com/kb/en/replace/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/replace * * @package database */ @@ -26,11 +26,11 @@ class Replace extends Statement use Traits\Values; /** - * @see https://mariadb.com/kb/en/insert-delayed/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert-delayed */ public const string OPT_DELAYED = 'DELAYED'; /** - * @see https://mariadb.com/kb/en/high_priority-and-low_priority/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/high_priority-and-low_priority */ public const string OPT_LOW_PRIORITY = 'LOW_PRIORITY'; diff --git a/src/Manipulation/Select.php b/src/Manipulation/Select.php index 64cf68c..413841c 100644 --- a/src/Manipulation/Select.php +++ b/src/Manipulation/Select.php @@ -10,14 +10,14 @@ namespace Framework\Database\Manipulation; use Closure; -use Framework\Database\Result; +use Framework\Database\Result\Result; use InvalidArgumentException; use LogicException; /** * Class Select. * - * @see https://mariadb.com/kb/en/select/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select * * @package database */ @@ -39,7 +39,7 @@ class Select extends Statement * Option to not retrieve identical rows. Remove duplicates from the result set. * * @see Select::renderOptions() - * @see https://mariadb.com/kb/en/select/#distinct + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select#distinct */ public const string OPT_DISTINCT = 'DISTINCT'; /** @@ -54,7 +54,7 @@ class Select extends Statement * Only supports table-level locking (MyISAM, MEMORY, MERGE). * * @see Select::renderOptions() - * @see https://mariadb.com/kb/en/high_priority-and-low_priority/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/high_priority-and-low_priority */ public const string OPT_HIGH_PRIORITY = 'HIGH_PRIORITY'; /** @@ -63,21 +63,21 @@ class Select extends Statement * For const and system table this option is sometimes ignored. * * @see Select::renderOptions() - * @see https://mariadb.com/kb/en/join-syntax/ - * @see https://mariadb.com/kb/en/index-hints-how-to-force-query-plans/#forcing-join-order + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/joins/join-syntax + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/query-optimizations/index-hints-how-to-force-query-plans#forcing-join-order */ public const string OPT_STRAIGHT_JOIN = 'STRAIGHT_JOIN'; /** * Forces the optimizer to use a temporary table. * - * @see https://mariadb.com/kb/en/optimizer-hints/#sql_small_result-sql_big_result + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimizer-hints/select-modifier-hints#sql_small_result-sql_big_result */ public const string OPT_SQL_SMALL_RESULT = 'SQL_SMALL_RESULT'; /** * Forces the optimizer to avoid usage of a temporary table. * * @see Select::renderOptions() - * @see https://mariadb.com/kb/en/optimizer-hints/#sql_small_result-sql_big_result + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimizer-hints/select-modifier-hints#sql_small_result-sql_big_result */ public const string OPT_SQL_BIG_RESULT = 'SQL_BIG_RESULT'; /** @@ -85,7 +85,7 @@ class Select extends Statement * This is useful to free locks as soon as possible. * * @see Select::renderOptions() - * @see https://mariadb.com/kb/en/optimizer-hints/#sql_buffer_result + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimizer-hints/select-modifier-hints#sql_buffer_result * * @var string */ @@ -95,8 +95,8 @@ class Select extends Statement * cacheable, SQL_CACHE causes the query to be cached. * * @see Select::renderOptions() - * @see https://mariadb.com/kb/en/server-system-variables/#query_cache_type - * @see https://mariadb.com/kb/en/query-cache/ + * @see https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#query_cache_type + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/query-cache */ public const string OPT_SQL_CACHE = 'SQL_CACHE'; /** @@ -104,8 +104,8 @@ class Select extends Statement * cacheable, SQL_NO_CACHE causes the query not to be cached. * * @see Select::renderOptions() - * @see https://mariadb.com/kb/en/server-system-variables/#query_cache_type - * @see https://mariadb.com/kb/en/query-cache/ + * @see https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#query_cache_type + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/buffers-caches-and-threads/query-cache */ public const string OPT_SQL_NO_CACHE = 'SQL_NO_CACHE'; /** @@ -114,7 +114,7 @@ class Select extends Statement * That number can be retrieved in the next query, using FOUND_ROWS(). * * @see Select::renderOptions() - * @see https://mariadb.com/kb/en/found_rows/ + * @see https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/information-functions/found_rows */ public const string OPT_SQL_CALC_FOUND_ROWS = 'SQL_CALC_FOUND_ROWS'; /** @@ -199,7 +199,7 @@ protected function renderOptions() : ?string * @param Closure|array|string $expression * @param Closure|array|string ...$expressions * - * @see https://mariadb.com/kb/en/select/#select-expressions + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select#select-expressions * * @return static */ @@ -249,7 +249,7 @@ protected function renderExpressions() : ?string * @param int $limit * @param int|null $offset * - * @see https://mariadb.com/kb/en/limit/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/limit * * @return static */ @@ -262,7 +262,7 @@ public function limit(int $limit, ?int $offset = null) : static * @param string $name * @param bool|float|int|string|null ...$arguments * - * @see https://mariadb.com/kb/en/procedure/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/procedure * * @return static */ @@ -296,7 +296,7 @@ protected function renderProcedure() : ?string * @param array $fieldsOptions Each key must be one of the EXP_FIELDS_* constants * @param array $linesOptions Each key must be one of the EXP_LINES_* constants * - * @see https://mariadb.com/kb/en/select-into-outfile/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select-into-outfile * * @return static */ @@ -385,7 +385,7 @@ private function partIntoOutfileLines() : ?string * @param string $filepath * @param string ...$variables * - * @see https://mariadb.com/kb/en/select-into-dumpfile/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select-into-dumpfile * * @return static */ @@ -422,7 +422,7 @@ protected function renderIntoDumpfile() : ?string /** * @param int|null $wait * - * @see https://mariadb.com/kb/en/for-update/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/for-update * * @return static */ @@ -438,7 +438,7 @@ public function lockForUpdate(?int $wait = null) : static /** * @param int|null $wait * - * @see https://mariadb.com/kb/en/lock-in-share-mode/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/lock-in-share-mode * * @return static */ diff --git a/src/Manipulation/Statement.php b/src/Manipulation/Statement.php index 7c973c2..4ab5c75 100644 --- a/src/Manipulation/Statement.php +++ b/src/Manipulation/Statement.php @@ -15,7 +15,7 @@ /** * Class Statement. * - * @see https://mariadb.com/kb/en/data-manipulation/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation * * @package database */ @@ -56,8 +56,8 @@ abstract protected function renderOptions() : ?string; * @param Closure $subquery A {@see Closure} having the current Manipulation * instance as first argument. The returned value must be scalar * - * @see https://mariadb.com/kb/en/subqueries/ - * @see https://mariadb.com/kb/en/built-in-functions/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/subqueries + * @see https://mariadb.com/docs/server/reference/sql-functions * * @return string */ @@ -72,7 +72,7 @@ protected function subquery(Closure $subquery) : string * @param int $limit * @param int|null $offset * - * @see https://mariadb.com/kb/en/limit/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/limit * * @return static */ @@ -165,7 +165,7 @@ protected function renderValue(Closure | float | int | string | null $value) : f * @param Closure|float|int|string|null $expression Expression/value * * @see Statement::renderValue() - * @see https://mariadb.com/kb/en/assignment-operators-assignment-operator/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/assignment-operators/assignment-operators-assignment-operator * * @return string */ diff --git a/src/Manipulation/Traits/Explain.php b/src/Manipulation/Traits/Explain.php index 0073e13..39a98d8 100644 --- a/src/Manipulation/Traits/Explain.php +++ b/src/Manipulation/Traits/Explain.php @@ -15,7 +15,7 @@ /** * Trait Explain. * - * @see https://mariadb.com/kb/en/explain/ + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain * * @package database * @@ -24,24 +24,24 @@ trait Explain { /** - * @see https://mariadb.com/kb/en/explain/#explain-extended + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain#explain-extended */ public const string EXP_EXTENDED = 'EXTENDED'; /** - * https://mariadb.com/kb/en/partition-pruning-and-selection/. + * @see https://mariadb.com/docs/server/server-usage/partitioning-tables/partition-pruning-and-selection */ public const string EXP_PARTITIONS = 'PARTITIONS'; /** - * @see https://mariadb.com/kb/en/explain-format-json/ + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain-format-json */ public const string EXP_FORMAT_JSON = 'FORMAT=JSON'; /** * EXPLAIN provides information about statements. * - * @param string|null $option + * @param string|null $option WARNING: This feature is MariaDB only. It is not compatible with MySQL. * - * @see https://mariadb.com/kb/en/explain/ + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain * * @return array */ diff --git a/src/Manipulation/Traits/GroupBy.php b/src/Manipulation/Traits/GroupBy.php index 514a610..cc3c7b5 100644 --- a/src/Manipulation/Traits/GroupBy.php +++ b/src/Manipulation/Traits/GroupBy.php @@ -14,7 +14,7 @@ /** * Trait GroupBy. * - * @see https://mariadb.com/kb/en/group-by/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/group-by * * @package database * diff --git a/src/Manipulation/Traits/Having.php b/src/Manipulation/Traits/Having.php index 3dfbbd2..bbd1d1c 100644 --- a/src/Manipulation/Traits/Having.php +++ b/src/Manipulation/Traits/Having.php @@ -60,7 +60,7 @@ public function orHaving( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/equal * * @return static */ @@ -77,7 +77,7 @@ public function havingEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/equal * * @return static */ @@ -94,7 +94,7 @@ public function orHavingEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/not-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-equal * * @return static */ @@ -111,7 +111,7 @@ public function havingNotEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/not-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-equal * * @return static */ @@ -128,7 +128,7 @@ public function orHavingNotEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/null-safe-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/null-safe-equal * * @return static */ @@ -145,7 +145,7 @@ public function havingNullSafeEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/null-safe-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/null-safe-equal * * @return static */ @@ -162,7 +162,7 @@ public function orHavingNullSafeEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/less-than/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/less-than * * @return static */ @@ -179,7 +179,7 @@ public function havingLessThan( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/less-than/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/less-than * * @return static */ @@ -196,7 +196,7 @@ public function orHavingLessThan( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/less-than-or-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/less-than-or-equal * * @return static */ @@ -213,7 +213,7 @@ public function havingLessThanOrEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/less-than-or-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/less-than-or-equal * * @return static */ @@ -230,7 +230,7 @@ public function orHavingLessThanOrEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/greater-than/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/greater-than * * @return static */ @@ -247,7 +247,7 @@ public function havingGreaterThan( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/greater-than/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/greater-than * * @return static */ @@ -264,7 +264,7 @@ public function orHavingGreaterThan( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/greater-than-or-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/greater-than-or-equal * * @return static */ @@ -281,7 +281,7 @@ public function havingGreaterThanOrEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/greater-than-or-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/greater-than-or-equal * * @return static */ @@ -298,7 +298,7 @@ public function orHavingGreaterThanOrEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/like/ + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/like * * @return static */ @@ -315,7 +315,7 @@ public function havingLike( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/like/ + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/like * * @return static */ @@ -332,7 +332,7 @@ public function orHavingLike( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/not-like/ + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/not-like * * @return static */ @@ -349,7 +349,7 @@ public function havingNotLike( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/not-like/ + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/not-like * * @return static */ @@ -367,7 +367,7 @@ public function orHavingNotLike( * @param Closure|float|int|string|null $value * @param Closure|float|int|string|null ...$values * - * @see https://mariadb.com/kb/en/in/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/in * * @return static */ @@ -386,7 +386,7 @@ public function havingIn( * @param Closure|float|int|string|null $value * @param Closure|float|int|string|null ...$values * - * @see https://mariadb.com/kb/en/in/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/in * * @return static */ @@ -405,7 +405,7 @@ public function orHavingIn( * @param Closure|float|int|string|null $value * @param Closure|float|int|string|null ...$values * - * @see https://mariadb.com/kb/en/not-in/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-in * * @return static */ @@ -424,7 +424,7 @@ public function havingNotIn( * @param Closure|float|int|string|null $value * @param Closure|float|int|string|null ...$values * - * @see https://mariadb.com/kb/en/not-in/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-in * * @return static */ @@ -443,7 +443,7 @@ public function orHavingNotIn( * @param Closure|float|int|string|null $min * @param Closure|float|int|string|null $max * - * @see https://mariadb.com/kb/en/between-and/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/between-and * * @return static */ @@ -462,7 +462,7 @@ public function havingBetween( * @param Closure|float|int|string|null $min * @param Closure|float|int|string|null $max * - * @see https://mariadb.com/kb/en/between-and/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/between-and * * @return static */ @@ -481,7 +481,7 @@ public function orHavingBetween( * @param Closure|float|int|string|null $min * @param Closure|float|int|string|null $max * - * @see https://mariadb.com/kb/en/not-between/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-between * * @return static */ @@ -500,7 +500,7 @@ public function havingNotBetween( * @param Closure|float|int|string|null $min * @param Closure|float|int|string|null $max * - * @see https://mariadb.com/kb/en/not-between/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-between * * @return static */ @@ -517,7 +517,7 @@ public function orHavingNotBetween( * * @param Closure|string $column Closure for a subquery or a string with the column name * - * @see https://mariadb.com/kb/en/is-null/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/is-null * * @return static */ @@ -531,7 +531,7 @@ public function havingIsNull(Closure | string $column) : static * * @param Closure|string $column Closure for a subquery or a string with the column name * - * @see https://mariadb.com/kb/en/is-null/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/is-null * * @return static */ @@ -545,7 +545,7 @@ public function orHavingIsNull(Closure | string $column) : static * * @param Closure|string $column Closure for a subquery or a string with the column name * - * @see https://mariadb.com/kb/en/is-not-null/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/is-not-null * * @return static */ @@ -559,7 +559,7 @@ public function havingIsNotNull(Closure | string $column) : static * * @param Closure|string $column Closure for a subquery or a string with the column name * - * @see https://mariadb.com/kb/en/is-not-null/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/is-not-null * * @return static */ diff --git a/src/Manipulation/Traits/Join.php b/src/Manipulation/Traits/Join.php index 68b4fa5..ec84e78 100644 --- a/src/Manipulation/Traits/Join.php +++ b/src/Manipulation/Traits/Join.php @@ -16,11 +16,9 @@ /** * Trait Join. * - * @see https://mariadb.com/kb/en/joins/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/joins * * @package database - * - * @todo STRAIGHT_JOIN - https://mariadb.com/kb/en/index-hints-how-to-force-query-plans/ */ trait Join { @@ -30,7 +28,7 @@ trait Join * @param Closure|array|string $reference Table reference * @param Closure|array|string ...$references Table references * - * @see https://mariadb.com/kb/en/join-syntax/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/joins/join-syntax * * @return static */ @@ -389,6 +387,33 @@ public function naturalRightOuterJoin( return $this->setJoin($table, 'NATURAL RIGHT OUTER'); } + /** + * Adds a JOIN clause with "STRAIGHT_JOIN $table". + * + * @param Closure|array|string $table Table factor + * + * @return static + */ + public function straightJoin(Closure | array | string $table) : static + { + return $this->setJoin($table, 'STRAIGHT_'); + } + + /** + * Adds a JOIN clause with "STRAIGHT_JOIN $table ON $conditional". + * + * @param Closure|array|string $table Table factor + * @param Closure $conditional Conditional expression + * + * @return static + */ + public function straightJoinOn( + Closure | array | string $table, + Closure $conditional + ) : static { + return $this->setJoin($table, 'STRAIGHT_', 'ON', $conditional); + } + /** * Sets the JOIN clause. * @@ -435,7 +460,7 @@ protected function renderJoin() : ?string $join['clause'], $join['expression'] ); - if ($type) { + if ($type && $type !== 'STRAIGHT_') { $type .= ' '; } if ($index > 0) { @@ -508,6 +533,7 @@ private function renderJoinType(string $type) : string 'NATURAL LEFT OUTER', 'NATURAL RIGHT', 'NATURAL RIGHT OUTER', + 'STRAIGHT_', ], true)) { return $result; } diff --git a/src/Manipulation/Traits/OrderBy.php b/src/Manipulation/Traits/OrderBy.php index 48312fe..6b913c5 100644 --- a/src/Manipulation/Traits/OrderBy.php +++ b/src/Manipulation/Traits/OrderBy.php @@ -14,7 +14,7 @@ /** * Trait OrderBy. * - * @see https://mariadb.com/kb/en/order-by/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/order-by * * @package database */ diff --git a/src/Manipulation/Traits/Select.php b/src/Manipulation/Traits/Select.php index 9b43c71..6c3b5fc 100644 --- a/src/Manipulation/Traits/Select.php +++ b/src/Manipulation/Traits/Select.php @@ -25,7 +25,7 @@ trait Select * * @param Closure $select * - * @see https://mariadb.com/kb/en/insert-select/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert-select * * @return static */ diff --git a/src/Manipulation/Traits/Where.php b/src/Manipulation/Traits/Where.php index 0d0910c..41c051a 100644 --- a/src/Manipulation/Traits/Where.php +++ b/src/Manipulation/Traits/Where.php @@ -63,7 +63,7 @@ public function orWhere( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/equal * * @return static */ @@ -80,7 +80,7 @@ public function whereEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/equal * * @return static */ @@ -97,7 +97,7 @@ public function orWhereEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/not-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-equal * * @return static */ @@ -114,7 +114,7 @@ public function whereNotEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/not-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-equal * * @return static */ @@ -131,7 +131,7 @@ public function orWhereNotEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/null-safe-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/null-safe-equal * * @return static */ @@ -148,7 +148,7 @@ public function whereNullSafeEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/null-safe-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/null-safe-equal * * @return static */ @@ -165,7 +165,7 @@ public function orWhereNullSafeEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/less-than/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/less-than * * @return static */ @@ -182,7 +182,7 @@ public function whereLessThan( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/less-than/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/less-than * * @return static */ @@ -199,7 +199,7 @@ public function orWhereLessThan( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/less-than-or-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/less-than-or-equal * * @return static */ @@ -216,7 +216,7 @@ public function whereLessThanOrEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/less-than-or-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/less-than-or-equal * * @return static */ @@ -233,7 +233,7 @@ public function orWhereLessThanOrEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/greater-than/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/greater-than * * @return static */ @@ -250,7 +250,7 @@ public function whereGreaterThan( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/greater-than/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/greater-than * * @return static */ @@ -267,7 +267,7 @@ public function orWhereGreaterThan( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/greater-than-or-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/greater-than-or-equal * * @return static */ @@ -284,7 +284,7 @@ public function whereGreaterThanOrEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/greater-than-or-equal/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/greater-than-or-equal * * @return static */ @@ -301,7 +301,7 @@ public function orWhereGreaterThanOrEqual( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/like/ + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/like * * @return static */ @@ -316,7 +316,7 @@ public function whereLike(Closure | string $column, Closure | float | int | stri * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/like/ + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/like * * @return static */ @@ -333,7 +333,7 @@ public function orWhereLike( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/not-like/ + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/not-like * * @return static */ @@ -350,7 +350,7 @@ public function whereNotLike( * @param Closure|string $column Closure for a subquery or a string with the column name * @param Closure|float|int|string|null $value * - * @see https://mariadb.com/kb/en/not-like/ + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/not-like * * @return static */ @@ -368,7 +368,7 @@ public function orWhereNotLike( * @param Closure|float|int|string|null $value * @param Closure|float|int|string|null ...$values * - * @see https://mariadb.com/kb/en/in/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/in * * @return static */ @@ -387,7 +387,7 @@ public function whereIn( * @param Closure|float|int|string|null $value * @param Closure|float|int|string|null ...$values * - * @see https://mariadb.com/kb/en/in/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/in * * @return static */ @@ -406,7 +406,7 @@ public function orWhereIn( * @param Closure|float|int|string|null $value * @param Closure|float|int|string|null ...$values * - * @see https://mariadb.com/kb/en/not-in/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-in * * @return static */ @@ -425,7 +425,7 @@ public function whereNotIn( * @param Closure|float|int|string|null $value * @param Closure|float|int|string|null ...$values * - * @see https://mariadb.com/kb/en/not-in/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-in * * @return static */ @@ -444,7 +444,7 @@ public function orWhereNotIn( * @param Closure|float|int|string|null $min * @param Closure|float|int|string|null $max * - * @see https://mariadb.com/kb/en/between-and/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/between-and * * @return static */ @@ -463,7 +463,7 @@ public function whereBetween( * @param Closure|float|int|string|null $min * @param Closure|float|int|string|null $max * - * @see https://mariadb.com/kb/en/between-and/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/between-and * * @return static */ @@ -482,7 +482,7 @@ public function orWhereBetween( * @param Closure|float|int|string|null $min * @param Closure|float|int|string|null $max * - * @see https://mariadb.com/kb/en/not-between/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-between * * @return static */ @@ -501,7 +501,7 @@ public function whereNotBetween( * @param Closure|float|int|string|null $min * @param Closure|float|int|string|null $max * - * @see https://mariadb.com/kb/en/not-between/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/not-between * * @return static */ @@ -518,7 +518,7 @@ public function orWhereNotBetween( * * @param Closure|string $column Closure for a subquery or a string with the column name * - * @see https://mariadb.com/kb/en/is-null/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/is-null * * @return static */ @@ -532,7 +532,7 @@ public function whereIsNull(Closure | string $column) : static * * @param Closure|string $column Closure for a subquery or a string with the column name * - * @see https://mariadb.com/kb/en/is-null/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/is-null * * @return static */ @@ -546,7 +546,7 @@ public function orWhereIsNull(Closure | string $column) : static * * @param Closure|string $column Closure for a subquery or a string with the column name * - * @see https://mariadb.com/kb/en/is-not-null/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/is-not-null * * @return static */ @@ -560,7 +560,7 @@ public function whereIsNotNull(Closure | string $column) : static * * @param Closure|string $column Closure for a subquery or a string with the column name * - * @see https://mariadb.com/kb/en/is-not-null/ + * @see https://mariadb.com/docs/server/reference/sql-structure/operators/comparison-operators/is-not-null * * @return static */ @@ -587,8 +587,8 @@ public function whereNotExists(Closure $subquery) * @param Closure|array|string>|string $columns Columns to MATCH * @param Closure|array|string>|string $against AGAINST expression * - * @see https://mariadb.com/kb/en/full-text-index-overview/ - * @see https://mariadb.com/kb/en/match-against/ + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/full-text-indexes/full-text-index-overview + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/match-against * * @return static */ @@ -606,8 +606,8 @@ public function whereMatch( * @param Closure|array|string>|string $columns Columns to MATCH * @param Closure|array|string>|string $against AGAINST expression * - * @see https://mariadb.com/kb/en/full-text-index-overview/ - * @see https://mariadb.com/kb/en/match-against/ + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/full-text-indexes/full-text-index-overview + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/match-against * * @return static */ @@ -625,8 +625,8 @@ public function orWhereMatch( * @param Closure|array|string>|string $columns Columns to MATCH * @param Closure|array|string>|string $against AGAINST expression * - * @see https://mariadb.com/kb/en/full-text-index-overview/ - * @see https://mariadb.com/kb/en/match-against/ + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/full-text-indexes/full-text-index-overview + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/match-against * * @return static */ @@ -644,8 +644,8 @@ public function whereMatchWithQueryExpansion( * @param Closure|array|string>|string $columns Columns to MATCH * @param Closure|array|string>|string $against AGAINST expression * - * @see https://mariadb.com/kb/en/full-text-index-overview/ - * @see https://mariadb.com/kb/en/match-against/ + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/full-text-indexes/full-text-index-overview + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/match-against * * @return static */ @@ -663,8 +663,8 @@ public function orWhereMatchWithQueryExpansion( * @param Closure|array|string>|string $columns Columns to MATCH * @param Closure|array|string>|string $against AGAINST expression * - * @see https://mariadb.com/kb/en/full-text-index-overview/ - * @see https://mariadb.com/kb/en/match-against/ + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/full-text-indexes/full-text-index-overview + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/match-against * * @return static */ @@ -682,8 +682,8 @@ public function whereMatchInBooleanMode( * @param Closure|array|string>|string $columns Columns to MATCH * @param Closure|array|string>|string $against AGAINST expression * - * @see https://mariadb.com/kb/en/full-text-index-overview/ - * @see https://mariadb.com/kb/en/match-against/ + * @see https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/full-text-indexes/full-text-index-overview + * @see https://mariadb.com/docs/server/reference/sql-functions/string-functions/match-against * * @return static */ diff --git a/src/Manipulation/Update.php b/src/Manipulation/Update.php index 1d31e67..c0827f2 100644 --- a/src/Manipulation/Update.php +++ b/src/Manipulation/Update.php @@ -16,7 +16,7 @@ /** * Class Update. * - * @see https://mariadb.com/kb/en/update/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/update * * @package database */ @@ -31,11 +31,11 @@ class Update extends Statement /** * Convert errors to warnings, which will not stop inserts of additional rows. * - * @see https://mariadb.com/kb/en/insert-ignore/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/insert-ignore */ public const string OPT_IGNORE = 'IGNORE'; /** - * @see https://mariadb.com/kb/en/high_priority-and-low_priority/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/high_priority-and-low_priority */ public const string OPT_LOW_PRIORITY = 'LOW_PRIORITY'; @@ -96,7 +96,7 @@ protected function renderTable() : string * * @param int $limit * - * @see https://mariadb.com/kb/en/limit/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/limit * * @return static */ diff --git a/src/Manipulation/With.php b/src/Manipulation/With.php index cead6d6..740a63f 100644 --- a/src/Manipulation/With.php +++ b/src/Manipulation/With.php @@ -10,21 +10,21 @@ namespace Framework\Database\Manipulation; use Closure; -use Framework\Database\Result; +use Framework\Database\Result\Result; use InvalidArgumentException; use LogicException; /** * Class With. * - * @see https://mariadb.com/kb/en/with/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/common-table-expressions/with * * @package database */ class With extends Statement { /** - * @see https://mariadb.com/kb/en/recursive-common-table-expressions-overview/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/common-table-expressions/recursive-common-table-expressions-overview */ public const string OPT_RECURSIVE = 'RECURSIVE'; @@ -50,8 +50,8 @@ protected function renderOptions() : ?string * @param Closure|string $table * @param Closure $alias * - * @see https://mariadb.com/kb/en/non-recursive-common-table-expressions-overview/ - * @see https://mariadb.com/kb/en/recursive-common-table-expressions-overview/ + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/common-table-expressions/non-recursive-common-table-expressions-overview + * @see https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/common-table-expressions/recursive-common-table-expressions-overview * * @return static */ diff --git a/src/PreparedStatement.php b/src/PreparedStatement.php index 59fb789..f389a1d 100644 --- a/src/PreparedStatement.php +++ b/src/PreparedStatement.php @@ -9,6 +9,7 @@ */ namespace Framework\Database; +use Framework\Database\Result\Result; use InvalidArgumentException; use RuntimeException; diff --git a/src/Result/Explain.php b/src/Result/Explain.php index 5751c3d..2f754ae 100644 --- a/src/Result/Explain.php +++ b/src/Result/Explain.php @@ -12,7 +12,7 @@ /** * Class Explain. * - * @see https://mariadb.com/kb/en/explain/ + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain * * @package database */ @@ -25,7 +25,7 @@ /** * What kind of SELECT the table comes from. * - * @see https://mariadb.com/kb/en/explain/#select_type-column + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain#select_type-column */ public string $selectType; /** @@ -36,7 +36,7 @@ /** * How rows are found from the table (join type). * - * @see https://mariadb.com/kb/en/explain/#type-column + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain#type-column */ public string $type; /** @@ -63,7 +63,7 @@ /** * Extra information about this join. * - * @see https://mariadb.com/kb/en/explain/#extra-column + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain#extra-column */ public string $extra; /** @@ -71,14 +71,14 @@ * is a percentage estimate of the table rows that will be filtered by the * condition. * - * @see https://mariadb.com/kb/en/explain/#explain-extended + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain#explain-extended */ public float $filtered; /** * EXPLAIN FORMAT=JSON is a variant of EXPLAIN command that produces output * in JSON form. * - * @see https://mariadb.com/kb/en/explain-format-json/ + * @see https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain-format-json */ public string $explain; diff --git a/src/Result.php b/src/Result/Result.php similarity index 98% rename from src/Result.php rename to src/Result/Result.php index d2d040b..084f326 100644 --- a/src/Result.php +++ b/src/Result/Result.php @@ -7,9 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Framework\Database; +namespace Framework\Database\Result; -use Framework\Database\Result\Field; use LogicException; use mysqli_result; use OutOfBoundsException; diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php index db18db2..7256486 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -25,7 +25,7 @@ use Framework\Database\Manipulation\Update; use Framework\Database\Manipulation\With; use Framework\Database\PreparedStatement; -use Framework\Database\Result; +use Framework\Database\Result\Result; use Framework\Log\Loggers\FileLogger; use mysqli_sql_exception; diff --git a/tests/Debug/DatabaseCollectorTest.php b/tests/Debug/DatabaseCollectorTest.php index d618778..3dab272 100644 --- a/tests/Debug/DatabaseCollectorTest.php +++ b/tests/Debug/DatabaseCollectorTest.php @@ -95,7 +95,8 @@ protected function makeDatabaseWithSocket() : Database public function testPort() : void { - $collector = new class() extends DatabaseCollector { + $collector = new class() extends DatabaseCollector + { protected function getHostInfo() : string { return '127.0.0.1 via TCP/IP'; @@ -109,7 +110,8 @@ protected function getHostInfo() : string public function testSocket() : void { - $collector = new class() extends DatabaseCollector { + $collector = new class() extends DatabaseCollector + { protected function getHostInfo() : string { return 'Localhost via UNIX socket'; diff --git a/tests/Manipulation/SelectTest.php b/tests/Manipulation/SelectTest.php index da10b7c..aaaaae0 100644 --- a/tests/Manipulation/SelectTest.php +++ b/tests/Manipulation/SelectTest.php @@ -11,7 +11,9 @@ use Closure; use Framework\Database\Manipulation\Select; -use Framework\Database\Result; +use Framework\Database\Result\Explain; +use Framework\Database\Result\Result; +use InvalidArgumentException; use Tests\Database\TestCase; final class SelectTest extends TestCase @@ -60,7 +62,7 @@ public function testOptions() : void public function testInvalidOption() : void { $this->select->options('al'); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Invalid option: al'); $this->select->sql(); } @@ -177,7 +179,7 @@ public function testInvalidIntoOutfileFieldOption() : void { $this->selectAllFrom('t1'); $this->select->intoOutfile('/tmp/foo-bar', null, ['foo' => 'bar']); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Invalid INTO OUTFILE fields option: foo'); $this->select->sql(); } @@ -186,7 +188,7 @@ public function testInvalidIntoOutfileLineOption() : void { $this->selectAllFrom('t1'); $this->select->intoOutfile('/tmp/foo-bar', null, [], ['foo' => 'bar']); - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Invalid INTO OUTFILE lines option: foo'); $this->select->sql(); } @@ -299,6 +301,32 @@ public function testOrderBy() : void ); } + public function testExplain() : void + { + $results = $this->select->from('t1')->where('c1', '=', 1)->explain(); + foreach ($results as $result) { + self::assertInstanceOf(Explain::class, $result); + } + } + + public function testExplainWithOption() : void + { + if (\getenv('DB_IMAGE') === 'mysql') { + $this->markTestSkipped(); + } + $results = $this->select->from('t1')->where('c1', '=', 1)->explain(Select::EXP_EXTENDED); + foreach ($results as $result) { + self::assertInstanceOf(Explain::class, $result); + } + } + + public function testExplainWithInvalidOption() : void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid EXPLAIN option: foo'); + $this->select->from('t1')->explain('foo'); + } + public function testRun() : void { $this->createDummyData(); diff --git a/tests/Manipulation/Traits/JoinTest.php b/tests/Manipulation/Traits/JoinTest.php index c5ec6cc..adec69a 100644 --- a/tests/Manipulation/Traits/JoinTest.php +++ b/tests/Manipulation/Traits/JoinTest.php @@ -273,4 +273,19 @@ public function testNaturalRightOuterJoin() : void $this->statement->naturalRightOuterJoin('t1'); self::assertSame(' NATURAL RIGHT OUTER JOIN `t1`', $this->statement->renderJoin()); } + + public function testStraightJoin() : void + { + $this->statement->straightJoin('t1'); + self::assertSame(' STRAIGHT_JOIN `t1`', $this->statement->renderJoin()); + } + + public function testStraightJoinOn() : void + { + $this->statement->straightJoinOn('t1', static fn () => 't1.id = t2.id'); + self::assertSame( + ' STRAIGHT_JOIN `t1` ON (t1.id = t2.id)', + $this->statement->renderJoin() + ); + } } diff --git a/tests/Manipulation/WithTest.php b/tests/Manipulation/WithTest.php index efc274e..9dfa494 100644 --- a/tests/Manipulation/WithTest.php +++ b/tests/Manipulation/WithTest.php @@ -11,7 +11,7 @@ use Framework\Database\Manipulation\Select; use Framework\Database\Manipulation\With; -use Framework\Database\Result; +use Framework\Database\Result\Result; use Tests\Database\TestCase; final class WithTest extends TestCase diff --git a/tests/PreparedStatementTest.php b/tests/PreparedStatementTest.php index 44f8edd..35c7dce 100644 --- a/tests/PreparedStatementTest.php +++ b/tests/PreparedStatementTest.php @@ -9,7 +9,7 @@ */ namespace Tests\Database; -use Framework\Database\Result; +use Framework\Database\Result\Result; final class PreparedStatementTest extends TestCase { diff --git a/tests/ResultEntity.php b/tests/Result/ResultEntity.php similarity index 93% rename from tests/ResultEntity.php rename to tests/Result/ResultEntity.php index d7844e0..f76cf50 100644 --- a/tests/ResultEntity.php +++ b/tests/Result/ResultEntity.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Tests\Database; +namespace Tests\Database\Result; #[\AllowDynamicProperties] class ResultEntity diff --git a/tests/ResultTest.php b/tests/Result/ResultTest.php similarity index 98% rename from tests/ResultTest.php rename to tests/Result/ResultTest.php index fa910e1..e1cfb2f 100644 --- a/tests/ResultTest.php +++ b/tests/Result/ResultTest.php @@ -7,9 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Tests\Database; +namespace Tests\Database\Result; -use Framework\Database\Result; +use Framework\Database\Result\Result; +use Tests\Database\TestCase; final class ResultTest extends TestCase {