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

Add time type arg support #20

Open
pahanini opened this issue Mar 30, 2017 · 4 comments
Open

Add time type arg support #20

pahanini opened this issue Mar 30, 2017 · 4 comments

Comments

@pahanini
Copy link

pahanini commented Mar 30, 2017

Now arg of type time in query function args will be replaced with ''

eg
clickhouse.NewQuery("Select * From event Where time > ?", time.Now())
will fail

@m1nor
Copy link
Contributor

m1nor commented Mar 30, 2017

Can't you pass it as string?

clickhouse.NewQuery("Select * From event Where time > '?'", time.Now().String())

@pahanini
Copy link
Author

@minor yes, we can use time.Format() but time type is frequently used type so it produces a lot of additional code. E.g.

clickhouse.NewQuery(sql, startDate.Format(Fmt), endDate.Format(Fmt))

Instead of

clickhouse.NewQuery(sql, startDate, endDate)

xsikor added a commit to xsikor/go-clickhouse that referenced this issue Apr 10, 2017
m1nor added a commit that referenced this issue Apr 10, 2017
Add time.Time type convert to clickHouse Date type #20 issue
@isage
Copy link

isage commented Jun 6, 2017

Accepted pull request actually makes things worse, because instead of converting time to DateTime it converts to Date, losing time part.

@isage
Copy link

isage commented Jun 7, 2017

Moreover, accepted pull request marshals time as unquoted string, which is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants