Skip to content

Add support for other postgres index types.#971

Merged
jwoertink merged 1 commit intomainfrom
issues/969
Oct 18, 2023
Merged

Add support for other postgres index types.#971
jwoertink merged 1 commit intomainfrom
issues/969

Conversation

@jwoertink
Copy link
Member

Fixes #969

While I was in there already, I just decided to add a few other supported index types. The only one I didn't add was the sp-gist which seems to be like gist but slightly more limited? I guess if anyone really wants it, we can add it in, but just made the code more complex since I couldn't just SpGist.to_s.downcase 😬


def initialize(@table : TableName, @columns : Columns, @using : Symbol = :btree, @unique = false, @name : String? | Symbol? = nil)
raise "index type '#{using}' not supported" unless ALLOWED_INDEX_TYPES.includes?(using.to_s)
def initialize(@table : TableName, @columns : Columns, using : Symbol = :btree, @unique = false, @name : String? | Symbol? = nil)
Copy link
Member Author

Choose a reason for hiding this comment

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

I was going to make this use the enum instead of a Symbol, but due to how the Crystal autocast works with passing a Symbol, it would have been a breaking change. This can be an optimization for later.

@jwoertink jwoertink merged commit 90f3828 into main Oct 18, 2023
@jwoertink jwoertink deleted the issues/969 branch October 18, 2023 15:13
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.

Support GIN indexes

1 participant