Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move index type constants to IndexType class #920

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Tigrov
Copy link
Member

@Tigrov Tigrov commented Jan 12, 2025

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues

Copy link

codecov bot commented Jan 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.62%. Comparing base (828b5db) to head (035c1c2).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #920   +/-   ##
=========================================
  Coverage     99.62%   99.62%           
  Complexity     1500     1500           
=========================================
  Files            81       81           
  Lines          3710     3710           
=========================================
  Hits           3696     3696           
  Misses           14       14           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

/**
* Defines the available index types. It is used in {@see DDLQueryBuilderInterface::createIndex()}.
*/
final class IndexType
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each DBMS has own list of index types, which almost do not overlap. May be remove IndexType from Yii DB and create separate IndexType in each implementation package?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just remove it. As far as I see only UNIQUE keyword makes sense.

DBMS Index types
MYSQL UNIQUE, FULLTEXT, SPATIAL
PGSQL UNIQUE
MSSQL UNIQUE, UNIQUE CLUSTERED, CLUSTERED, SPATIAL, COLUMNSTORE, CLUSTERED COLUMNSTORE, XML, PRIMARY XML
SQLITE UNIQUE
ORACLE UNIQUE, BITMAP, MULTIVALUE
DBMS Index methods
MYSQL BTREE (by default), HASH, RTREE (MARIADB)
PGSQL BTREE (by default), HASH, GIST, SPGIST, GIN, BRIN
MSSQL BTREE (there is no option)
SQLITE BTREE (there is no option)
ORACLE BTREE (there is no option), depends on index type

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also other indexes can potentially be added using extensions. It seems, there is such opportunity in PostgreSQL.

Сlasses with constants may be convient to use in userland. Remove it from Yii DB, but add for DBMS-specific packages. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants