aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
* Refactor quoting of binary data to not be based on the column typeSean Griffin2014-06-031-4/+3
|
* Ensure we always use instances of the adapter specific column classSean Griffin2014-05-281-1/+1
| | | | | | - Create a consistent API across adapters for building new columns - Use it for custom properties so we don't get `UndefinedMethodError`s in stuff I'm implementing elsewhere.
* Replace `type_cast` case statement with delegationSean Griffin2014-05-201-11/+1
| | | | | | | | All subclasses of column were now delegating `type_cast` to their injected type object. We can remove the overriding methods, and generalize it on the `Column` class itself. This also enabled us to remove several column classes completely, as they no longer had any meaningful behavior of their own.
* Delegate `#type_cast` to injected type objects on SQLite3Sean Griffin2014-05-201-6/+20
|
* Remove :timestamp column typeSean Griffin2014-05-191-1/+0
| | | | | | | | | | | | The `:timestamp` type for columns is unused. All database adapters treat them as the same database type. All code in `ActiveRecord` which changes its behavior based on the column's type acts the same in both cases. However, when the type is passed to code that checks for the `:datetime` type, but not `:timestamp` (such as XML serialization), the result is unexpected behavior. Existing schema definitions will continue to work, and the `timestamp` type is transparently aliased to `datetime`.
* Add a type object to Column constructorSean Griffin2014-05-171-1/+3
| | | | | | Part of #15134. In order to perform typecasting polymorphically, we need to add another argument to the constructor. The order was chosen to match the `oid_type` on `PostgreSQLColumn`.
* refactor, move `column_for` to `AbstractAdapter` for better reuse.Yves Senn2014-05-041-5/+3
|
* Merge pull request #13640 from maginatics/fix_sqlite3_ensure_masterRafael Mendonça França2014-05-011-3/+6
|\ | | | | | | | | | | | | SQLite3: Always close statements. Conflicts: activerecord/CHANGELOG.md
| * SQLite3: Always close statements.Timur Alperovich2014-01-151-3/+6
| | | | | | | | | | | | SQLite3 adapter must make sure to close statements after queries. Fixes: #13631
* | Merge branch 'master' into adequaterecordAaron Patterson2014-04-201-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (74 commits) [ci skip] builtin -> built-in Fix code indentation and improve formatting Grammar fix in Getting Started Guide Make URL escaping more consistent Optimize URI escaping Always escape string passed to url helper. Remove statement assuming coffee shop/public space wifi is inherently insecure Don't rely on Arel master in bug report template [ci skip] wrap methods in backticks [ci skip] "subhash" --> "sub-hash" multibyte_conformance.rb --> multibyte_conformance_test.rb Fix inconsistent behavior from String#first/#last `@destroyed` should always be set to `false` when an object is duped. remove warning `warning: ambiguous first argument; put parentheses or even spaces` :uglify -> :uglifier Regression test for irregular inflection on has_many Singularize association names before camelization Fix spelling and proper nouns Optimize select_value, select_values, select_rows and dry up checking whether to exec with cache for Postgresql adapter Include default rails protect_from_forgery with: :exception ... Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
| * | Bring SQLite3Adpter init API closer to othersArthur Neves2014-04-171-2/+2
| | |
* | | push the collectors up to the abstract adapterAaron Patterson2014-04-091-20/+0
| | |
* | | sqlite3 tests passing againAaron Patterson2014-04-091-7/+8
| | |
* | | add a bind collector, remove the bind visitorAaron Patterson2014-04-091-6/+22
| | |
* | | Merge branch 'master' into adequaterecordAaron Patterson2014-04-071-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (122 commits) Rails.application should be set inside before_configuration hook remove check for present? from delete_all Remove useless begin..end Build the reverse_order on its proper method. Use connection-specific bytea escaping Ignore order when doing count. make enums distinct per class Remove unused `subclass_controller_with_flash_type_bar` var from flash test. fix CollectionProxy delete_all documentation Added OS X specific commands to installation guide [ci skip] Recommended using homebrew for installing MySQL and PostgreSQL Fix setup of adding _flash_types test. Use SVG version of travis build status badge [skip ci] W3C CSP document moved to gihub.io URL [ci skip] sprockets-rails was released Fix the test defining the models in the right place Add CHANGELOG entry for #11650 [ci skip] Declare the assets dependency Use sass-rails 4.0.3 Make possible to use sprockets-rails 2.1 add missing parentheses to validates_with documentation [skip ci] ...
| * | PostgreSQL and SQLite, remove varchar limit. [Vladimir Sazhin & Toms Mikoss ↵Yves Senn2014-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | & Yves Senn] There is no reason for the PG adapter to have a default limit of 255 on :string columns. See this snippet from the PG docs: Tip: There is no performance difference among these three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of the three because of its additional storage costs. In most situations text or character varying should be used instead.
| * | Clarify 'database does not exist' message and implementation.Jeremy Kemper2014-04-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Clarify what the situation is and what to do. * Advise loading schema using `rake db:setup` instead of migrating. * Use a rescue in the initializer rather than extending the error message in-place. * Preserve the original backtrace of other errors by using `raise` rather than raising again with `raise error`. References 0ec45cd15d0a2f5aebc75e23d841b6c12f3ba763
* | | Merge branch 'master' into adequaterecordAaron Patterson2014-02-171-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (311 commits) Add a missing changelog entry for #13981 and #14035 Revert "Fixed plugin_generator test" implements new option :month_format_string for date select helpers [Closes #13618] add factory methods for empty alias trackers guarantee a list in the alias tracker so we can remove a conditional stop exposing table_joins make most parameters to the AliasTracker required make a singleton for AssociationScope pass the association and connection to the scope method pass the tracker down the stack and construct it in the scope method clean up add_constraints signature remove the reflection delegate remove klass delegator remove railties changes. fixes #14054 remove chain delegate remove scope_chain delegate Add verb to sanitization note fix path shown in mailer's templates updated Travis build status image url fix guide active_support_core_extensions. add Note to String#indent [ci skip] ... Conflicts: activerecord/lib/active_record/associations/join_dependency.rb activerecord/test/cases/associations/association_scope_test.rb
| * | Fix regression on `.select_*` methods.Arthur Neves2014-01-301-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a common pattern: ``` query = author.posts.select(:title) connection.select_one(query) ``` However `.select` returns a ActiveRecord::AssociationRelation, which has the bind information, so we can use that to get the right sql query. Also fix select_rows on postgress and sqlite3 that were not using the binds [fixes #7538] [fixes #12017] [related #13731] [related #12056]
* | remove dead codeAaron Patterson2014-01-171-7/+0
| |
* | comment out the sqlite3 debug code (for now)Aaron Patterson2014-01-141-0/+7
| |
* | Merge branch 'master' into set_bindsAaron Patterson2014-01-141-1/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * master: don't establish a new connection when testing with `sqlite3_mem`. sqlite >= 3.8.0 supports partial indexes Don't try to get the subclass if the inheritance column doesn't exist Enum mappings are now exposed via class methods instead of constants. Fix fields_for documentation with index option [ci skip] quick pass through Active Record CHANGELOG. [ci skip] [ci skip] Grammar correction single quotes for controller generated routes [ci skip] Added alias to CSRF Set NameError#name
| * sqlite >= 3.8.0 supports partial indexesCody Cutrer2014-01-141-1/+17
| |
* | explains for prepared statements should never have binds in SQLite3Aaron Patterson2014-01-131-1/+1
|/
* Raise NoDatabaseError when db does not existschneems2013-12-241-0/+6
| | | Building on the work of #13427 this PR adds a helpful error message to the adapters: mysql, mysql2, and sqlite3
* Merge pull request #13291 from strzibny/new_unique_constraintYves Senn2013-12-121-1/+5
|\ | | | | Translate new unique constraint error message for sqlite >= 3.8.2
| * Translate new unique constraint for sqlite >= 3.8.2Josef Stribny2013-12-121-1/+5
| |
* | Remove the unused, undocumented SQLite3Adapter#supports_count_distinct?Ben Woosley2013-11-121-5/+0
| | | | | | | | This has returned true since 3cc9b5f1, and is not used internally.
* | Drop a sqlite_version check because we only support SQLite 3.6.16 or newer.Ben Woosley2013-11-121-6/+1
| | | | | | Drop some comments that document the implementation rather than the interface.
* | Don't use Active Support where we don't need toRafael Mendonça França2013-11-091-1/+1
| |
* | log bind variables after they were type casted.Yves Senn2013-11-091-4/+5
|/ | | | | | | | | | | | | | | The log output used to be confusing in situation where type casting has "unexpected" effects. For example when finding records with a `String`. BEFORE: irb(main):002:0> Event.find("im-no-integer") D, [2013-11-09T11:10:28.998857 #1706] DEBUG -- : Event Load (4.5ms) SELECT "events".* FROM "events" WHERE "events"."id" = $1 LIMIT 1 [["id", "im-no-integer"]] AFTER: irb(main):002:0> Event.find("im-no-integer") D, [2013-11-09T11:10:28.998857 #1706] DEBUG -- : Event Load (4.5ms) SELECT "events".* FROM "events" WHERE "events"."id" = $1 LIMIT 1 [["id", 0]]
* Remove `default_primary_key_type` and extract contains of ↵Vipul A M2013-10-141-18/+16
| | | | `native_database_types` to a constant since they aren't conditional now in SQLite3Adapter. Makes it more like other adapters.
* Merge pull request #11833 from vipulnsward/remove_autoincrementRafael Mendonça França2013-10-141-10/+1
|\ | | | | Remove sqlite specific`supports_autoincrement?` which defaults to true
| * Remove sqlite specific`supports_autoincrement?` which always defaults to trueVipul A M2013-08-101-10/+1
| |
* | extract adapter savepoint implementations into `abstract/savepoints.rb`.Yves Senn2013-09-301-12/+2
| |
* | change the savepoint interface to allow passing the name.Yves Senn2013-09-301-6/+6
| |
* | Check if the SQL is not a prepared statementRafael Mendonça França2013-09-111-2/+3
|/ | | | | | | | | When the adapter is with prepared statement disabled and the binds array is not empty the connection adapter will try to set the binds values and will fail. Now we are checking if the adapter has the prepared statement disabled. Fixes #12023
* Remove redundant `string_to_binary` from type-castingVipul A M2013-08-091-2/+2
|
* config[:database] should be a stringRafael Mendonça França2013-08-051-3/+3
| | | | | This change was breaking the Railties tests. See https://travis-ci.org/rails/rails/jobs/9865969
* Create sqlite3 directory if not presentschneems2013-08-051-3/+5
| | | | | | | | | | | If the `db/` directory is not present on a remote machine it will blow up in unexpected ways with error messages that do not indicate there is a missing directory: ``` SQLite3::CantOpenException: unable to open database file ``` This PR checks to see if a directory exists for the sqlite3 file and if not creates it for you. This PR is an alternative to #11692 as suggested by @josevalim
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-03-301-2/+2
|\ | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb activerecord/test/cases/adapter_test.rb guides/source/testing.md [ci skip]
| * nodoc AR::ConnectionHandling for adapters [ci skip]Francesco Rodriguez2013-03-151-2/+2
| |
* | added comments to test_invalid_type in sqlite3 adapter test and added ↵Ranjay Krishna2013-03-281-4/+0
| | | | | | | | valid_type? method to abstract_adapter.rb and removed unnecessary method from sqlite3 adapter
* | Created a layer of abstraction for the valid type checking in schema dumper. ↵Ranjay Krishna2013-03-251-0/+4
| | | | | | | | Now, connection handles the check for valid types so that each database can handle the changes individually.
* | keep ivars private, do not manipulate them outside their owner objectAaron Patterson2013-03-221-1/+1
| |
* | Pass column to quote when copying a sqlite table.Matthew M. Boedicker2013-03-111-1/+9
|/ | | | To make quote escape binary data correctly it needs the column passed in.
* Unprepared Visitor + unprepared_statementCédric FABIANSKI2013-03-081-1/+1
|
* Do not type cast all the database url values.Rafael Mendonça França2013-02-241-3/+3
| | | | | | We should only type cast when we need to use. Related to 4b005fb371c2e7af80df7da63be94509b1db038c
* also rename indexes when a table or column is renamedYves Senn2013-02-201-2/+4
| | | | When a table or a column is renamed related indexes kept their name. This will lead to confusing names. This patch renames related indexes when a column or a table is renamed. Only indexes with names generated by rails will be renamed. Indexes with custom names will not be renamed.
* reserve less chars for internal sqlite3 operationsYves Senn2013-02-201-7/+7
|