SciRuby / daru

Data Analysis in RUby
BSD 2-Clause "Simplified" License
1.04k stars 139 forks source link

Can open SQL databases by specifying file name #301

Closed dshvimer closed 7 years ago

dshvimer commented 7 years ago

Let me know if anything looks unsightly

dshvimer commented 7 years ago

@zverok This PR is in response to #298

I will refactor the work later tonight and try to simplify things.

zverok commented 7 years ago

This PR is in response to #298

Well, I am not sure that SQLite is the only type of database that could be distributed as a file. At least I've seen some governmental data to be distributed in DBFs and MS Access, for example. I am not sure it is a frequent case, but not sure about SQLite databases either. So, I feel like to solve #298 you should first clarify its scope (by investigating "which formats of binary DB files are available on popular scientfic/governmental/business datasources), and only then the coding attempt.

dshvimer commented 7 years ago

@zverok I refactored what I had. Changes:

  1. I am reusing the DBI adapter instead of implementing a SQLite3 adapter.
  2. Stronger condition for whether a file path is being passed in.

Let me know how it looks from your perspective.

In regards to DBF's: I am wrestling with support for SQL queries. It seems that this gem does not support them. Thoughts?

dshvimer commented 7 years ago

@zverok I made the changes to the test cases as you recommended. Let me if anything else needs to be done.

v0dro commented 7 years ago

The Travis build is failing. Rubocop.

dshvimer commented 7 years ago

Sorry about that. Rubocop is now all green

v0dro commented 7 years ago

Good to go from my side. @zverok needs to approve and merge.