sportdb / sport.db

sport.db - open sports database (e.g. football.db, formula1.db etc.) command line tool and libraries
Creative Commons Zero v1.0 Universal
221 stars 29 forks source link

datetime contents broken #2

Closed hansmaulwurf23 closed 10 years ago

hansmaulwurf23 commented 10 years ago

Hi!

First of all thanks for all the effort you spend on free sports data projects like these! :-)

I do have a problem though when using the sqlite database as the datetime fields seem to be broken. For example the games table offers play_at, created_at and updated_at, which hold values in the format 'yyyy-MM-dd HH:mm:ss' (for play_at) and 'yyyy-MM-dd HH:mm:ss.SSSSSS' (for the created and updated fields). AFAIK sqlite3 seems to support 'yyyy-MM-dd HH:ss:SSS' only (http://www.sqlite.org/datatype3.html). The mapping within a JDBC driver won't work otherwise. I tried to fiddle around with your code in the sport.db.ruby, specifically adding

play_at.strftime( '%Y-%m-%d %H:%M:%S.%L' )

at https://github.com/geraldb/sport.db.ruby/blob/master/lib/sportdb/models/game.rb#L309 to fix the issue with play_at (which seemed most important ;)) but I am pretty new to ruby and failed to install/build the sportdb gem because of this:

ERROR:  While executing gem ... (Gem::InvalidSpecificationException)
    [".gemtest", "History.md", "data/setups/all.yml", "lib/sportdb/title.rb", "test/test_round.rb"] are not files

Any help would be much appreciated! Cheers Martin

geraldb commented 10 years ago

The mapping within a JDBC driver won't work otherwise.

Can you please clarify - are you using JRuby (the Java version) e.g is this a JDBC issue w/ SQLite3?

Sorry. Not sure what's the bug/issue. Are you trying to load/read some fixtures into a database? Which one? What's the error? Cheers.

geraldb commented 10 years ago

Doesn't seem to be a bug - looks more like a usage issue -> can you please post your questions to the forum/mailing list. Thanks. Cheers.