-
Notifications
You must be signed in to change notification settings - Fork 208
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 over CSV with tests and docs #1146
Conversation
Cool. This is nice 👍 |
core/templating/datasource_query.go
Outdated
conditions := query.Conditions | ||
setClauses := query.SetClauses | ||
for i, row := range (*data)[1:] { | ||
rowMap := mapRow(headers, row) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started to think that it might be better to store the data as []map[string]string
rather than [][]string
if we are doing a lot of querying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - might be worth doing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not done - should be simple enough to refactor but quite a lot of changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's leave it for another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new templating functions only, LGTM
Added support for SELECT, UPDATE, DELETE over CSV data sources in csvSQL template function.
Intention is to allow users to simulate a persistent CRUD datastore in a straightforward manner.
This in addition to template function earlier for simpler datasource manipulation.
Have included tests and documentation.
I am not sure how the documentation will render once compiled.