Source code for tortoise.contrib.postgres.indexes
from tortoise.indexes import PartialIndex
class PostgreSQLIndex(PartialIndex):
INDEX_CREATE_TEMPLATE = (
"CREATE INDEX {exists}{index_name} ON {table_name} USING{index_type}({fields}){extra};"
)
[docs]class BloomIndex(PostgreSQLIndex):
INDEX_TYPE = "BLOOM"
[docs]class BrinIndex(PostgreSQLIndex):
INDEX_TYPE = "BRIN"
[docs]class GinIndex(PostgreSQLIndex):
INDEX_TYPE = "GIN"
[docs]class GistIndex(PostgreSQLIndex):
INDEX_TYPE = "GIST"
[docs]class HashIndex(PostgreSQLIndex):
INDEX_TYPE = "HASH"
[docs]class SpGistIndex(PostgreSQLIndex):
INDEX_TYPE = "SPGIST"