Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/Database/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,25 @@ abstract public function getInternalIndexesKeys(): array;
*/
abstract public function getSchemaAttributes(string $collection): array;

/**
* Get the expected column type for a given attribute type.
*
* Returns the database-native column type string (e.g. "VARCHAR(255)", "BIGINT")
* that would be used when creating a column for the given attribute parameters.
* Returns an empty string if the adapter does not support this operation.
*
* @param string $type
* @param int $size
* @param bool $signed
* @param bool $array
* @param bool $required
* @return string
*/
public function getColumnType(string $type, int $size, bool $signed = true, bool $array = false, bool $required = false): string
{
return '';
}

/**
* Get the query to check for tenant when in shared tables mode
*
Expand Down
5 changes: 5 additions & 0 deletions src/Database/Adapter/SQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,11 @@ abstract protected function getSQLType(
bool $required = false
): string;

public function getColumnType(string $type, int $size, bool $signed = true, bool $array = false, bool $required = false): string
{
return $this->getSQLType($type, $size, $signed, $array, $required);
}
Comment thread
abnegate marked this conversation as resolved.

/**
* Get SQL Index Type
*
Expand Down
Loading