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

[FEATURE] - Redis Support #494

Open
1 task done
briandowns opened this issue Dec 27, 2021 · 6 comments
Open
1 task done

[FEATURE] - Redis Support #494

briandowns opened this issue Dec 27, 2021 · 6 comments
Labels
feature request Discussion about a new feature

Comments

@briandowns
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

Not necessarily a problem but more so a need for use with Redis.

Describe the solution you'd like

A module like the sqlite module that provides a simple API for use with Redis databases.

Describe alternatives you've considered

The use of the socket module could be used and the content parsed and marshalled to and from however this seems tedious for the implementer.

Additional context

I have an implementation that can be ported into Dictu.

@briandowns briandowns added the feature request Discussion about a new feature label Dec 27, 2021
@Jason2605
Copy link
Member

I did make an incredibly simple implementation a while back to connect to Redis in Dictu. I think this is probably one of those things that would benefit greatly if a package manager was available. I don't think I would have a stdlib module for Redis, but I'm very happy to spin up a new Repo under the Dictu organisation here on Github if that interests you?

@briandowns
Copy link
Contributor Author

Makes sense. I'd be curious how to do a package in C that could be imported. I did the Redis implementation in C and can push the branch if you're interested. Along with that, I started work on a generic "database" package that would have a "new" function and take some config. In that config would be an indicator of the driver to use; mysql, redis, sqlite, postgres, etc and a generic interface to run queries with. I ended up getting side tracked and didn't finish it.

@Jason2605
Copy link
Member

I wrote out a comment for this but seems it was lost to the ether 😢 Anyways, let me write it back out!

I'd be curious how to do a package in C that could be imported.

Yeah thats currently not quite possible, there is no FFI in Dictu which would allow C code outside of the interpreter to be ran at runtime. Something that definitely needs adding eventually else everything would either need to be in the interpreter or written in Dictu, which isn't really feasible.

Luckily the Redis protocol isn't too difficult to implement something manually in Dictu (not saying you have to do this, I'm just saying from my previous attempt; although I didn't get too complex with it, so it could get harder).

Along with that, I started work on a generic "database" package that would have a "new" function and take some config. In that config would be an indicator of the driver to use; mysql, redis, sqlite, postgres, etc and a generic interface to run queries with.

A single API that deals with multiple different database dialects is always nice!

I ended up getting side tracked and didn't finish it.

Hah! I've been there many-a-time.

@liz3
Copy link
Contributor

liz3 commented Jan 20, 2024

I wrote out a comment for this but seems it was lost to the ether 😢 Anyways, let me write it back out!

I'd be curious how to do a package in C that could be imported.

Yeah thats currently not quite possible, there is no FFI in Dictu which would allow C code outside of the interpreter to be ran at runtime. Something that definitely needs adding eventually else everything would either need to be in the interpreter or written in Dictu, which isn't really feasible.

Luckily the Redis protocol isn't too difficult to implement something manually in Dictu (not saying you have to do this, I'm just saying from my previous attempt; although I didn't get too complex with it, so it could get harder).

Along with that, I started work on a generic "database" package that would have a "new" function and take some config. In that config would be an indicator of the driver to use; mysql, redis, sqlite, postgres, etc and a generic interface to run queries with.

A single API that deals with multiple different database dialects is always nice!

I ended up getting side tracked and didn't finish it.

Hah! I've been there many-a-time.

Ive been playing around with something ffi-like, even if very early and very wip
image

@Jason2605
Copy link
Member

@liz3 This would be an incredible addition!!

@briandowns
Copy link
Contributor Author

Agreed. I was looking at this last night and the potential is huge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Discussion about a new feature
Projects
None yet
Development

No branches or pull requests

3 participants