Граф коммитов

236 Коммитов

Автор SHA1 Сообщение Дата
John Nunemaker efcf6acd7b
Always require pp for debugging in tests 2017-10-13 10:24:00 -04:00
John Nunemaker 9f70dfeab0
Fix formatting of assert_equal 2017-10-13 09:59:43 -04:00
John Nunemaker b87591eea9
Move time zone enforcement to quoting of dates/times
This makes it work for `interpolate` and `sanitize` when used outside of
`add`. Without this, those will both not force tz.

I don't think this needs to be wrapped around any other connection
quotes as it only relates to dates/times, but let me know if I'm wrong.

I left the enforce timezone in results because those use connection as
well and wasn't 100% confident that I could remove without issue. Likely
it would be fine and I can look into it later.
2017-10-13 09:55:09 -04:00
John Nunemaker b3053e6b33
Add doc for forze timezone method 2017-10-13 09:52:51 -04:00
John Nunemaker cde7598be0
Extract time zone enforcement into single method
To ensure it is always performed correctly.
2017-10-13 09:46:50 -04:00
John Nunemaker ca049ffcc2
Fix unused variable warning 2017-10-13 09:44:09 -04:00
Charlie Somerville 06dc07a571 Merge pull request #28 from github/charliesome/rails4
Ensure @hash_results is an array on rails 4
2017-09-28 18:13:52 +02:00
Charlie Somerville 1086e92a92 update CHANGELOG for v0.2.7 2017-09-28 17:59:51 +02:00
Charlie Somerville a0c72b2f75 bump version to 0.2.7 2017-09-28 17:58:10 +02:00
Charlie Somerville b0772a1cfa ensure hash_results is an array on rails 4
Rails 4 changes the return type of select_all from Array to
ActiveRecord::Result
2017-09-28 17:56:06 +02:00
Charlie Somerville db1f986607 Merge pull request #26 from github/missing-requirement
Add missing require_relative to `github-ds.rb`
2017-09-28 17:55:30 +02:00
miguelff 40a060a638 s/requires/require/g 2017-09-22 15:43:59 +02:00
miguelff f7de3685db Bump version.rb and update CHANGELOG.md 2017-09-22 15:12:39 +02:00
miguelff 67f0ea37bc Add a missing require_relative 2017-09-22 15:08:25 +02:00
Miguel Fernández 23e3dbb351 Merge pull request #25 from github/require-relative
Replace absolute `require` statements in favor of `require_relative`
2017-09-22 14:13:15 +02:00
miguelff c2d9494709 Bump version.rb and update CHANGELOG.md 2017-09-22 14:05:43 +02:00
miguelff 3a2168be2b Remove unneeded require from README.md 2017-09-22 14:00:47 +02:00
miguelff cb50e5318c Replace absolute with relative requires 2017-09-22 13:59:08 +02:00
Miguel Fernández 2e4e19faa7 Merge pull request #24 from github/transaction
Adds `SQL.transaction`
2017-09-20 17:53:06 +02:00
miguelff f89a430973 Bumps version to 0.2.4 2017-09-20 17:47:50 +02:00
miguelff 7161e2b791 Adds `SQL.transaction`
To add support for running queries inside an
`ActiveRecord::Base.transaction` scope
2017-09-20 17:45:23 +02:00
Miguel Fernández 6781dd5272 Merge pull request #23 from github/v023
v0.2.3
2017-09-20 17:24:15 +02:00
miguelff 8d5d22d352 Adds @miguelff to list of maintainers 2017-09-20 17:17:39 +02:00
miguelff 5d5e3df27a Bump Version to 0.2.3 2017-09-20 17:13:37 +02:00
miguelff a22c397eaa Do not depend on `active_support/core_ext/object/blank` 2017-09-20 17:11:37 +02:00
John Nunemaker 0bf11a5b56 Merge pull request #22 from github/scope-ensures
Scope `ensures` to only run if default_timezone actually altered
2017-09-20 10:42:52 -04:00
John Nunemaker 6e800e7ae7
Scope ensure to only run when timezone was actually modified
See
e442e84a72
for longer description of fix.
2017-09-20 10:37:41 -04:00
John Nunemaker 99032a2f5d
Failing test to demonstrate bug in results 2017-09-20 10:36:32 -04:00
John Nunemaker e442e84a72
Fix bug in add
ensure at the method level runs on every method call, even early returns
like the return self if sql.blank? check.

This means that timezone was being set to nil sometimes if
force_timezone was used and the sql was blank (early return). This fixes
that bug.
2017-09-20 10:34:19 -04:00
John Nunemaker 1435886104
Add failing test to demonstrate bug 2017-09-20 10:33:10 -04:00
John Nunemaker 0b4d98f64d Merge pull request #21 from github/literal-values
Adds support for binary values in `GitHub::KV`
2017-09-14 11:02:16 -04:00
miguelff 6780068567 Update Changelog 2017-09-14 13:37:46 +02:00
miguelff 167b5233cf Bump version to 0.2.2 2017-09-14 12:26:53 +02:00
miguelff 3b7c6b4df8 Use SQL::Literal in error message 2017-09-14 12:23:00 +02:00
miguelff 5156f95ef0 Validate value length based on its bytesize
We are capped by the number of bytes in the BLOB column that represents
the value.

If the string is a 65K unicode characters long, it would be truncated,
that's why we need to take into account its length in bytes.
2017-09-14 09:30:38 +02:00
miguelff c11d4e3154 Let KV values be SQL::Literal instances 2017-09-14 09:24:50 +02:00
John Nunemaker da8bc3a6bf
Only create database if not existing
refs https://github.com/github/github-ds/pull/20
2017-08-31 10:26:48 -04:00
John Nunemaker a52d9be267 Merge pull request #20 from JuanitoFatas/jf.add-a-models-test
Add a test for GitHub::SQL#models
2017-08-31 10:20:03 -04:00
Juanito Fatas 1b2a327626 Add a test for GitHub::SQL#models 2017-08-18 01:43:41 +09:00
John Nunemaker c9e2f8f678
Release 0.2.1 2017-07-14 10:00:59 -04:00
John Nunemaker e42141e1ad Merge pull request #19 from github/no-block
Make initialize without block return `true` for `ok?`
2017-07-14 09:59:35 -04:00
John Nunemaker ad12d0d482
Make initialize without block return true for ok?
It was returning false because the lack of a block would yield a local
jump error which would then be rescued setting error and thus ok? to
false.
2017-07-13 20:39:00 -04:00
John Nunemaker 4742af5692 Merge pull request #17 from github/rails-51
Rails 5.1 CI/Support
2017-05-22 16:58:25 -04:00
John Nunemaker b811044faf
Add migration version for rails 5.1
Left off for older versions. This also makes it so the generator is used for examples and tests instead of requiring the file directly, since the file now has erb in it.
2017-05-22 16:48:16 -04:00
John Nunemaker c309d6be19
Add username to ar connection
I noticed some denied errors when missing this.
2017-05-22 11:19:46 -04:00
John Nunemaker f8121a2dc7
Ignore db directory
Rails migration gets generated there.
2017-05-22 11:17:38 -04:00
John Nunemaker 0cfbfd716b
Release 0.2.0 2017-05-22 10:34:17 -04:00
John Nunemaker 0e5c29cf75
Changelog formatting tweak 2017-05-22 10:34:05 -04:00
John Nunemaker 14ff8abcf6
Add changelog 2017-05-22 10:33:42 -04:00
John Nunemaker f396896f19 Merge pull request #16 from github/rails-generator-name
Use `Ds` for generator module to correct generator name
2017-05-22 10:29:44 -04:00