This repository has been archived by the owner on Apr 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature improvement and psr-12 support
Added - ColumnDefinition object for simplifying the configuration of columns. - Cascade support for column foreign keys. - Support for using other types of default values. Refactor - Updated package to be in compliance with PSR-12. Changed - Default value for nullable in abstract table query set to false.
- Loading branch information
1 parent
b28ec0c
commit 4b44bd2
Showing
81 changed files
with
819 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
language: php | ||
php: | ||
- '7.2' | ||
- '7.3' | ||
- '7.4' | ||
|
||
before_script: | ||
- composer install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
cacheResult="false"> | ||
<testsuites> | ||
<testsuite name="default"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="default"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) GrizzIT, Inc. All rights reserved. | ||
* See LICENSE for license details. | ||
*/ | ||
|
||
namespace Ulrack\Dbal\Sql\Common; | ||
|
||
use GrizzIt\Enum\Enum; | ||
|
||
/** | ||
* @method static CascadeEnum NO_ACTION() | ||
* @method static CascadeEnum CASCADE() | ||
* @method static CascadeEnum SET_NULL() | ||
* @method static CascadeEnum SET_DEFAULT() | ||
*/ | ||
class CascadeEnum extends Enum | ||
{ | ||
public const NO_ACTION = 'NO ACTION'; | ||
public const CASCADE = 'CASCADE'; | ||
public const SET_NULL = 'SET NULL'; | ||
public const SET_DEFAULT = 'SET DEFAULT'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) GrizzIT, Inc. All rights reserved. | ||
* See LICENSE for license details. | ||
*/ | ||
|
||
namespace Ulrack\Dbal\Sql\Common; | ||
|
||
use Ulrack\Dbal\Sql\Common\ColumnTypeEnum; | ||
use Ulrack\Dbal\Sql\Common\ColumnAttributeEnum; | ||
|
||
interface ColumnDefinitionInterface | ||
{ | ||
/** | ||
* Get the column name. | ||
* | ||
* @return string | ||
*/ | ||
public function getName(): string; | ||
|
||
/** | ||
* Set the column name. | ||
* | ||
* @param string $name | ||
* | ||
* @return void | ||
*/ | ||
public function setName(string $name): void; | ||
|
||
/** | ||
* Get the column type. | ||
* | ||
* @return ColumnTypeEnum | ||
*/ | ||
public function getType(): ColumnTypeEnum; | ||
|
||
/** | ||
* Set the column type. | ||
* | ||
* @param ColumnTypeEnum $type | ||
* | ||
* @return void | ||
*/ | ||
public function setType(ColumnTypeEnum $type): void; | ||
|
||
/** | ||
* Get the type option value. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getTypeOption(): ?string; | ||
|
||
/** | ||
* Set the column type option. | ||
* | ||
* @param string|null $typeOption | ||
* | ||
* @return string|null | ||
*/ | ||
public function setTypeOption(?string $typeOption): void; | ||
|
||
/** | ||
* Get the default value. | ||
* | ||
* @return ColumnDefaultEnum|mixed | ||
*/ | ||
public function getDefault(); | ||
|
||
/** | ||
* Set the default value. | ||
* | ||
* @param ColumnDefaultEnum|mixed $default | ||
* | ||
* @return void | ||
*/ | ||
public function setDefault($default): void; | ||
|
||
/** | ||
* Get the attribute. | ||
* | ||
* @return ColumnAttributeEnum|null | ||
*/ | ||
public function getAttribute(): ?ColumnAttributeEnum; | ||
|
||
/** | ||
* Set the attribute. | ||
* | ||
* @param ColumnAttributeEnum|null $attribute | ||
* | ||
* @return void | ||
*/ | ||
public function setAttribute(?ColumnAttributeEnum $attribute): void; | ||
|
||
/** | ||
* Whether the column is nullable. | ||
* | ||
* @return bool | ||
*/ | ||
public function isNullable(): bool; | ||
|
||
/** | ||
* Set whether the column is nullable. | ||
* | ||
* @param bool $nullable | ||
* | ||
* @return void | ||
*/ | ||
public function setIsNullable(bool $nullable): void; | ||
|
||
/** | ||
* Whether the column is automatically incrementing. | ||
* | ||
* @return bool | ||
*/ | ||
public function isAutoIncrement(): bool; | ||
|
||
/** | ||
* Set whether the column is automatically incrementing. | ||
* | ||
* @param bool $autoIncrement | ||
* | ||
* @return void | ||
*/ | ||
public function setIsAutoIncrement(bool $autoIncrement): void; | ||
|
||
/** | ||
* Whether the value of the column must be unique. | ||
* | ||
* @return bool | ||
*/ | ||
public function isUnique(): bool; | ||
|
||
/** | ||
* Set whether the column should be unique. | ||
* | ||
* @param bool $unique | ||
* | ||
* @return void | ||
*/ | ||
public function setIsUnique(bool $unique): void; | ||
|
||
/** | ||
* Get the column comment. | ||
* | ||
* @return string | ||
*/ | ||
public function getComment(): string; | ||
|
||
/** | ||
* Set the column comment. | ||
* | ||
* @param string $comment | ||
* | ||
* @return void | ||
*/ | ||
public function setComment(string $comment): void; | ||
} |
Oops, something went wrong.