Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return arrays of common data types as PGArray instances automatically…
… with much improved performance This modifies the array parser to accept an oid and dataset in addition to the conversion proc. If the oid is set, this uses similar logic as the default type conversion code for converting each array element. The default type conversion code now recognizes arrays of common types and now calls the array parser directly with the scalar type oid set, so that the entire array can be parsed without creating a ruby string for it (though a ruby string is still created for the per-element buffer). This improves performance about 10% for string arrays, 3x for integer arrays, and 5-6x for timestamp arrays. Array types are now returned as PGArray instances, and sequel_pg now loads the pg_array extension file to support that. However, the pg_array extension should still be loaded into the Database manually if you want to handle custom array types, arrays as bound variable arguments, and other more advanced features. This also exposes the SEQUEL_PG_VERSION_INTEGER to ruby, as Sequel may need to check this to determine the sequel_pg version to allow for version-specific behavior.
- Loading branch information