-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix issue with `time` type * Fix issue with negative numerics * Remove support for `send_at_once`, it is now synchronous by default * Use `copy_data` block from pg * Use `sync_put_copy_data` from pg and flush at the end * Add support for `geometry` and `geogrphy` * Add integrations tests using a Dummy rails App (See [spec/dummy](spec/dummy)) * Remove the unused `use_tempfile` options from `EncodeForCopy` * Add explicit dependency to the [pg](https://rubygems.org/gems/pg/versions/1.3.4) gem, with a version minimum to 1.3.0 as we are using the `sync_put_copy_data` method
- Loading branch information
Showing
76 changed files
with
929 additions
and
1,107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DATABASE_URL='postgis://postgres:postgres@localhost:5577' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ spec/reports | |
test/tmp | ||
test/version_tmp | ||
tmp | ||
spec/dummy/log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,15 @@ MyModel.find_by(field_1: 'abc') | |
Credits to [Pete Brumm](https://github.com/pbrumm) who wrote pg_data_encoder and | ||
which this library repurposes. | ||
|
||
## Developing | ||
|
||
``` | ||
./start-local-db.sh | ||
cd spec/dummy | ||
bundle install | ||
DATABASE_URL='postgis://postgres:postgres@localhost:5577' rake db:create db:migrate db:test:prepare | ||
``` | ||
|
||
## LICENSE | ||
|
||
Copyright (c) 2018, Lukas Fittl <[email protected]><br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3" | ||
services: | ||
db: | ||
image: postgres/postgres | ||
ports: | ||
- "5577:5432" | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_HOST_AUTH_METHOD: "trust" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module ActiveRecordCopy | ||
class ColumnHelper | ||
def self.find_column_type(column) | ||
if column.type == :integer | ||
if column.limit == 8 | ||
:bigint | ||
elsif column.limit == 2 | ||
:smallint | ||
else | ||
:integer | ||
end | ||
elsif column.sql_type == 'real' | ||
:real | ||
else | ||
column.type | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.