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

blob_t implementation #125

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

blob_t implementation #125

wants to merge 1 commit into from

Conversation

aminroosta
Copy link
Collaborator

@zauguin @Killili Please review this PR :-)
There might be a better approach, so far i've came up with this.

#122

@zauguin
Copy link
Collaborator

zauguin commented May 24, 2017

Except for the sqlite_config, this is with .vec the only place the interface relies on public data members. What do you think about using sth. like operator *, because blob_t is a wrapper and we want to access the underlying object?

@Killili
Copy link
Collaborator

Killili commented May 24, 2017

I like it, it makes a lot more sense than just having vector<> as an option for operator<< to make blobs.
What this implies is "use a blob to store x" and x is a vector because thats all we can handle for now. But blob() can be expanded on in the future to handle all kinds of stuff.
So i do not like that it is an interface for vector only but i like it for the expend-ability later on. It sets an example for how we might handle custom data types later on or even explicitly choosing the SQL Type like:

auto val = get_something_numerical_maybe_float_or_int();
db << "insert ...." << val; // might end up numeric or real
db << "insert ...." << real(val); // will always be a real or error if for example its out of range

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.

3 participants