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

added tinyint and smallint as int8 and int16 #15

Closed
wants to merge 2 commits into from
Closed

added tinyint and smallint as int8 and int16 #15

wants to merge 2 commits into from

Conversation

crisward
Copy link
Contributor

@crisward crisward commented Dec 3, 2016

Hopefully fixes #12

@crisward
Copy link
Contributor Author

crisward commented Dec 3, 2016

I've noticed with both these Int8, Int16 and Time types, they needed to be added here too,
https://github.com/crystal-lang/crystal-db/blob/master/src/db.cr#L72

otherwise I get the following errror

in src/app/pages/page-repository.cr:105: instantiating 'DB::Database#exec(String, (String | Nil), (Int32 | Nil), (String | Nil), (String | Nil), (String | Nil), (Int8 | Nil), (Int8 | Nil), (Int32 | Nil), (String | Nil), String, String, Int32)'

      res = @db.exec("
                ^~~~

I'm using db v.0.2.0

@crisward
Copy link
Contributor Author

crisward commented Dec 7, 2016

The failing tests seem to have nothing to do with the code pushed.
Any idea when travis will be fixed and if this change will be merged. Working from by own fork at the moment but it's not ideal.

@bcardiff
Copy link
Member

bcardiff commented Dec 7, 2016

squashed/merged at a1db0df.
I added some missing specs for covering the params binding of the last commit

diff --git a/spec/driver_spec.cr b/spec/driver_spec.cr
index 36a7a9b..24164b7 100644
--- a/spec/driver_spec.cr
+++ b/spec/driver_spec.cr
@@ -96,7 +96,7 @@ describe Driver do
     end
   end
 
-  {% for value in [1, 1_i64, "hello", 1.5, 1.5_f32] %}
+  {% for value in [54_i16, 1_i8, 5_i8, 1, 1_i64, "hello", 1.5, 1.5_f32] %}
     it "executes and select nil as type of {{value.id}}" do
       with_db do |db|
         db.scalar("select null").should be_nil

Thanks!

@bcardiff bcardiff closed this Dec 7, 2016
@crisward
Copy link
Contributor Author

crisward commented Dec 7, 2016

Cool, many thanks.

@bcardiff bcardiff mentioned this pull request Dec 7, 2016
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

Successfully merging this pull request may close these issues.

support TINYINT(1)
2 participants