Performance improvement for TRUNCATE on Postgres
Remove #compress_lines call in DataMapper adapter.
…ormance due to avoiding cascades
… a core extension anymore by DataMapper as of 1.1.
The connection caching was a little bit too liberal and was caching across databases (I think). No we just grab it when we enter clean. Added an iterator so there isn't too much code duplication between delete and truncate.
Due to pools etc eveything we called connection_klass.connection we would get a different connection. I hit a bug using multiple DBs where eventually the connection that did the referential integrity would not exist anymore and then everything would fail when it tried to reset the foreign keys.
--- The first commit works, for versions of postgresql up to 9.* The second should work for any and all future versions of postgresql, as long as the implementation of postgresql_version in ActiveRecord doesnt change...
…h version 10+
--- The array passed does not belong to us, and so we should dup it before we modify it (via append in this case).
… to us.
--- As described here http://www.mongodb.org/display/DOCS/Mongo+Metadata MongoDb system collections starts with system. <-- notice the dot at the end, not just with system. This is important becouse when I have system_admins collection in my database it is not truncated. :( So here is a fix for that case.
--- This solves the following issue: when truncating in postgresql, the sequences are not reset. If you have a test that depends on records getting specific ids when created, the test could fail.