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

sql: Add DATE/TIMESTAMP/INTERVAL parameters #2328

Closed
vivekmenezes opened this issue Sep 2, 2015 · 3 comments
Closed

sql: Add DATE/TIMESTAMP/INTERVAL parameters #2328

vivekmenezes opened this issue Sep 2, 2015 · 3 comments
Assignees
Labels
E-easy Easy issue to tackle, requires little or no CockroachDB experience
Milestone

Comments

@vivekmenezes
Copy link
Contributor

These parameter types have to be embedded in the sql. Allow passing these as parameters.

@vivekmenezes vivekmenezes added the E-easy Easy issue to tackle, requires little or no CockroachDB experience label Sep 2, 2015
@vivekmenezes vivekmenezes self-assigned this Sep 2, 2015
@vivekmenezes vivekmenezes added this to the Beta milestone Sep 2, 2015
@petermattis
Copy link
Collaborator

Supporting date/timestamp parameters should be straightforward (we're already passing time.Time parameters to the server, just not using them). Passing interval will be more interesting as there is not native support for time.Duration. While that type is simply an int64, I worry about the type checking after FillArgs is called. Argument filling might need to be augmented so that it is passed the expected type of the argument. Maybe. I haven't looked at this enough to be sure.

@petermattis petermattis added the SQL label Sep 2, 2015
@vivekmenezes
Copy link
Contributor Author

I think we can have the user specify the type in the SQL. So when passing in an interval they would use an int64 and specify "INTERVAL $3" in the sql. Same with Date, "Date $4," where $4 is of type time.Time

@petermattis
Copy link
Collaborator

Ah, yes, that should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Easy issue to tackle, requires little or no CockroachDB experience
Projects
None yet
Development

No branches or pull requests

2 participants