dinedal / textql

Execute SQL against structured text like CSV or TSV
MIT License
9.06k stars 300 forks source link

Add support for `sqlite3Storage.db.Exec` #61

Closed franklinkim closed 6 years ago

franklinkim commented 8 years ago

Hi, guess this is more or less a proposal at the moment as it's not directly adding any features to the command line tool itself:

I'm using your code programmatically and would like to be able to have access to sqlite3Storage.db.Exec, i.e.:

...
s := storage.NewSQLite3StorageWithDefaults()
s.LoadInput("/path/to.csv")
r, err := s.Exec("DELETE foo from BAR")
if err != nil {
  return nil, err
}
c, err := r.RowsAffected()
if err != nil {
  return nil, err
}
s.Close()
...
dinedal commented 6 years ago

I like this proposal but can not merge it as is; mostly because the names of publicly accessible functions have changed, this will break projects that depend on this code.

dinedal commented 6 years ago

I do want to say thank you for taking the time to write this proposal

franklinkim commented 6 years ago

Thanks for the implementation, great work!