Skip to content

Add Trilogy#118

Open
jdelStrother wants to merge 2 commits intopat:developfrom
jdelStrother:trilogy
Open

Add Trilogy#118
jdelStrother wants to merge 2 commits intopat:developfrom
jdelStrother:trilogy

Conversation

@jdelStrother
Copy link
Copy Markdown
Contributor

(I wanted to add this as a stacked pull request on top of my modernizing branch, but maybe Github doesn't let you do that across forks..? I'll resubmit if & when #117 gets merged)

This adds the groundwork for allowing Riddle/ThinkingSphinx to talk to Sphinx/Manticore using the Trilogy gem, rather than mysql2.

Before it gets merged, I want to make sure ThinkingSphinx is also going to work ok with it, but thought I should open this to check it's not going in completely the wrong direction in the meantime.

@pat
Copy link
Copy Markdown
Owner

pat commented Apr 11, 2026

Thanks Jonathan! If you could rebase this now that #117's merged, that'd be great :)

It's not supported by Trilogy
Introduces Riddle::SQLClient.connection for creating a connection using either mysql2 or trilogy.
If the trilogy gem is available, it will use that by default.

Tests continue to use mysql2 by default, unless overridden with, eg, `SPHINX_SQL_ADAPTER=trilogy rake`.


Note that trilogy 2.11 isn't compatible with manticore, throwing a TRILOGY_TRUNCATED_PACKET error. Use 2.12+.
(trilogy-libraries/trilogy#270)
@pat
Copy link
Copy Markdown
Owner

pat commented Apr 13, 2026

I realise this is still marked as a draft, but FWIW the code is all looking fine to me :)

@jdelStrother
Copy link
Copy Markdown
Contributor Author

Cool, thanks for checking. Before merging this I wanted to make sure it was going to work ok at the thinking-sphinx level... I'd wondered if ThinkingSphinx::Connection::MRI should make use of riddle's Riddle::SQLClient logic, but actually I think it's probably going to be simplest to have a little extra duplication and split ThinkingSphinx::Connection::MRI into ThinkingSphinx::Connection::Mysql2 & ThinkingSphinx::Connection::Trilogy.

@jdelStrother jdelStrother marked this pull request as ready for review April 13, 2026 12:36
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.

2 participants