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

Allow for using :uuid as primary_key #1209

Open
anthonyshull opened this issue Oct 6, 2021 · 2 comments
Open

Allow for using :uuid as primary_key #1209

anthonyshull opened this issue Oct 6, 2021 · 2 comments

Comments

@anthonyshull
Copy link
Contributor

There are a few places where it is assumed that applications are using the default :bigint primary_key and therefore have rt_attr_bigint = sphinx_internal_id. We are using :uuid. I have made some hacky changes to my fork to get it working with uuids. I can devote some time to make it work with the rest of the library. I'm thinking some kind of config variable. The default can use bigint but you can also set it to uuid. Thoughts?

@pat
Copy link
Owner

pat commented Oct 6, 2021

@anthonyshull thanks for the suggestion! In the past I'd said this wasn't possible… but that was back when Sphinx didn't fully handle String attributes. And given you've gotten it working, it sounds like it is possible!

I guess the preferred behaviour I'd love is that TS figures out that the primary key isn't an integer/bigint automatically, and just switches to using a string attribute instead for sphinx_internal_id, rather than requiring a change at a config level. If you want to have a go at that, that'd be brilliant. If you get stuck though (I realise there's a lot going on in the TS code), I'm happy to have a look at your fork and see if we can figure out next steps together.

@anthonyshull
Copy link
Contributor Author

Ok, looks like I can get the primary key type from the model. I'll try to have a PR this week.

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

No branches or pull requests

2 participants