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

Take byte slice instead of string #1

Closed
jesusrmoreno opened this issue Apr 6, 2016 · 2 comments
Closed

Take byte slice instead of string #1

jesusrmoreno opened this issue Apr 6, 2016 · 2 comments

Comments

@jesusrmoreno
Copy link

Is there a reason that you require a string instead of a byte slice? If we know that bolt saves a byte slice why require that it be a string? Doesn't that just limit the types of data that can be used?

If you take a byte slice instead of a string that opens it up for storing any arbitrary data such as gob encoded data, or json, etc..

@xyproto
Copy link
Owner

xyproto commented Apr 7, 2016

simplebolt (for BoltDB), simpleredis (for Redis) and simplemaria (for MariaDB/MySQL) all provide the same functions and satisfy the same interface. The communication with Redis and MariaDB is only via strings. Since the simple* database backends are meant to be interchangeable, also supporting bytes would require adding functions for handling bytes (with conversion from byte to string) for the database backends that require strings.

For now, only dealing with strings for simplebolt is a feature/limitation by design.

One solution is to add functions to only simplebolt and not the other, but then easy interchangeability of database engines would be lost.

Another solution could be to fork simplebolt and create something like bytebolt.

If performance is critical, using the Bolt database package directly might be most desirable.

I'm open for good ideas.

@xyproto xyproto closed this as completed Apr 7, 2016
@jesusrmoreno
Copy link
Author

Ah that makes sense then thanks for the prompt reply!

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