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

Support timespan and datetime in where cli arguments #85

Open
itaywaisman opened this issue Mar 1, 2025 · 2 comments
Open

Support timespan and datetime in where cli arguments #85

itaywaisman opened this issue Mar 1, 2025 · 2 comments

Comments

@itaywaisman
Copy link

Hey folks!
Wanted to first share my appreciation for this project - thank you for that.

Adding support for dates and timespan will be great and would allow extracting tables with a time filter.
I see this is currently not handled in main.go

	case proto.ColumnType_DATETIME, proto.ColumnType_TIMESTAMP:
		//t, err := time.Parse("Mon Jan 2 15:04:05 MST 2006", valueString)
		//if err != nil{
		//	return nil, err
		//}
		//result.Value = &proto.QualValue_TimestampValue{TimestampValue: t}
		// todo parse

I thought about adding support using ISO datetimes:

	case proto.ColumnType_DATETIME, proto.ColumnType_TIMESTAMP:
              t, err := time.Parse(time.RFC3339, valueString)
              if err != nil{
              	return nil, err
              }
              ts := timestamppb.New(t)
      		result.Value = &proto.QualValue_TimestampValue{TimestampValue: ts}

What do you think? I can open a PR.

Thank you for the amazing work so far!

@pskrbasu
Copy link
Collaborator

pskrbasu commented Mar 3, 2025

@itaywaisman We would love a PR 👍 !! Let us know if you need any help!

@itaywaisman
Copy link
Author

Hey @pskrbasu - opened a PR here
Let me know what do you think 🙏
Thanks!

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