aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* | Remove deprecated `name` argument from `#tables`Rafael Mendonça França2016-12-291-7/+1
| |
* | Fix Rubocop violations and fix documentation visibilityRafael Mendonça França2016-12-281-2/+2
| | | | | | | | | | | | Some methods were added to public API in 5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of the public API.
* | Privatize unneededly protected methods in Active RecordAkira Matsuda2016-12-241-10/+9
| |
* | Translate NOT NULL violation to the specific exceptionRyuta Kamizono2016-12-061-0/+2
| | | | | | | | | | Raise `ActiveRecord::NotNullViolation` when a record cannot be inserted or updated because it would violate a not null constraint.
* | Change MySQL and Postgresql to use Bigint primary keysJon McCartie2016-12-051-0/+2
| |
* | Make `:auto_increment` to internal primary key optionRyuta Kamizono2016-12-061-0/+9
| | | | | | | | | | | | Using `:auto_increment` option for abstracting the DB-specific auto incremental types. It is worth to ease to implement the compatibility layer.
* | Add `:nodoc` to `table_structure`Ryuta Kamizono2016-11-121-9/+2
| | | | | | | | | | | | | | | | Follow up to #27008. `table_structure` is an internal method so it is better to hide it in the doc. And alias `table_structure` to `column_definitions` to remove the duplicated `columns` method in the sqlite3 adapter.
* | Refactor column initialization into `new_column_from_field`Kir Shatrov2016-11-111-12/+16
| | | | | | | | that accepts results of SHOW FIELDS
* | Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-6/+6
| |
* | Fix the variable scoping issue I introduced in ↵Matthew Draper2016-10-281-2/+2
| | | | | | | | 007e50d8e5a900547471b6c4ec79d9d217682c5d
* | Permit loads while queries are runningMatthew Draper2016-10-271-19/+25
| | | | | | | | | | A query may wait on a database-level lock, which could lead to a deadlock between threads.
* | Quote table name properlyRyuta Kamizono2016-10-141-4/+6
| | | | | | | | If does not quote table name properly, invalid SQL is generated.
* | Add three new rubocop rulesRafael Mendonça França2016-08-161-5/+5
| | | | | | | | | | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* | normalizes indentation and whitespace across the projectXavier Noria2016-08-061-3/+3
| |
* | modernizes hash syntax in activerecordXavier Noria2016-08-061-6/+6
| |
* | applies new string literal convention in activerecord/libXavier Noria2016-08-061-40/+40
| | | | | | | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* | Merge pull request #25523 from kamipo/extract_quoted_binds_type_casted_bindsSean Griffin2016-07-261-3/+3
|\ \ | | | | | | Extract `type_casted_binds` method
| * | Extract `type_casted_binds` methodRyuta Kamizono2016-07-261-3/+3
| | | | | | | | | | | | | | | Because `type_cast` against `binds` always requires `attr.value_for_database` and this pattern appears frequently.
* | | systematic revision of =~ usage in ARXavier Noria2016-07-231-1/+1
|/ / | | | | | | | | Where appropriatei, prefer the more concise Regexp#match?, String#include?, String#start_with?, or String#end_with?
* | Pass `type_casted_binds` to log subscriber for logging bind values properlyRyuta Kamizono2016-07-191-1/+1
| | | | | | | | Address to https://github.com/rails/rails/commit/5a302bf553af0e6fedfc63299fc5cd6e79599ef3#commitcomment-18288388.
* | rails -> Rails [ci skip]Santosh Wadghule2016-07-121-1/+1
|/
* Fix some typos in comments.Joe Rafaniello2016-05-041-1/+1
| | | | [ci skip]
* Dont simply assume a type is a valid database type. This is only always true ↵Vipul A M2016-04-251-0/+4
| | | | | | | in the case of sqlite. Others adapters need to perform a check for validity. Add coverage for mysql2 db type validation
* Follow up of #23461Vipul A M2016-04-241-1/+1
| | | | | | | | - Rename max to statement_limit - Remove magic number 1000 from everywhere - Defined StatementPool::DEFAULT_STATEMENT_LIMIT and started using it everywhere Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* Include the Savepoints module in all adapters.Vipul A M2016-04-241-1/+0
| | | | | Adapters override `#supports_savepoints?` to return `true` if they support transaction savepoints. Defaults to `false`.
* Move `select_rows` implementation to super classRyuta Kamizono2016-04-241-4/+0
|
* https://github.com/rails/rails/commit/42dd2336b31a8d98776d039a2b9fd7f834156a ↵Vipul A M2016-04-231-0/+4
| | | | | | | | | 78 changed INSERT INTO versions to run in 1 single query. This breaks for sqlite versions < 3.7.11, which is especially the case on Ubuntu 12.04 LTS, that has SQLite version 3.7.9 as default. So we check for support for multi insert, before performing single query inserts, else fallback to older version of running multiple queries. [Vipul A M & Yasuo Honda]
* Define `arel_visitor` method on all adaptersRyuta Kamizono2016-04-201-0/+4
| | | | `Arel::Visitors::VISITORS` was removed at https://github.com/rails/arel/pull/412.
* Merge pull request #23515 from kamipo/extract_arel_visitorJeremy Daer2016-04-191-9/+0
|\ | | | | | | Extract `arel_visitor` and move up to the abstract adapter
| * Extract `arel_visitor` and move up to the abstract adapterRyuta Kamizono2016-04-041-9/+0
| |
* | Move `quoted_date`, `quote_string` and `quote_table_name_for_assignment` ↵Ryuta Kamizono2016-04-051-10/+0
|/ | | | methods to `Quoting` module
* Move `@quoted_{column|table}_names` cache up to the abstract adapterRyuta Kamizono2016-03-311-5/+0
|
* Make to private the visibility of `_quote` and `_type_cast`Ryuta Kamizono2016-03-301-24/+3
|
* Passing `table_name` to `Column#initialize` to avoid `instance_variable_set`Ryuta Kamizono2016-03-081-3/+1
|
* Initialize `column.table_name` immediately for `column.serial?` correctly ↵Ryuta Kamizono2016-03-081-2/+5
| | | | | | | | working Currently the results of `column.serial?` is not correct. For `column.serial?` correctly working, initialize `column.table_name` immediately.
* SQLite 2 support has been dropped [ci skip]Ryuta Kamizono2016-02-041-1/+0
|
* Extract `ExplainPrettyPrinter` to appropriate filesRyuta Kamizono2016-02-011-15/+2
|
* `{update|delete}_sql` are almost the same as `{update|delete}`Ryuta Kamizono2016-01-081-5/+0
| | | | Simply `{update|delete}_sql` aliases to `{update|delete}`.
* Remove `delete_sql` in sqlite3 adapterRyuta Kamizono2016-01-071-5/+0
| | | | | `sql += " WHERE 1=1"` was introduced in 69cb942. But it is not needed. ref https://www.sqlite.org/lang_delete.html
* Refactor `connection.insert_sql`Ryuta Kamizono2016-01-071-5/+0
| | | | `connection.insert_sql` is almost the same as `connection.insert`.
* Fix `connection#create` in PG adapterRyuta Kamizono2016-01-051-1/+0
| | | | | | Originally `connection#create` had aliased to `connection#insert` in PG adapter. But it was broken by #7447. Re-alias `create` to `insert` for fixing it.
* Support supports_datetime_with_precision? for sqlite3Yasuo Honda2015-11-301-0/+4
|
* Refactor `AbstractAdapter#initialize`Ryuta Kamizono2015-11-301-2/+1
| | | | `pool` in args is unused anymore. And `config` is used in all adapters.
* Deprecate `#table_exists?`, `#tables` and passing arguments to `#talbes`yui-knk2015-11-091-2/+26
| | | | | | | | | | Reported on #21509, how views is treated by `#tables` are differ by each adapters. To fix this different behavior, after Rails 5.0 is released, deprecate `#tables`. And `#table_exists?` would check both tables and views. To make their behavior consistent with `#tables`, after Rails 5.0 is released, deprecate `#table_exists?`.
* Deprecate exception#original_exception in favor of exception#causeYuki Nishijima2015-11-031-2/+2
|
* Remove `#tables` extra args againRyuta Kamizono2015-10-221-12/+8
| | | | | | This issue was resolved by #21687 already. But re-add args by #18856. `#tables` extra args was only using by `#table_exists?`. This is for internal API. This commit will remove these extra args again.
* Do not cache prepared statements that are unlikely to have cache hitsSean Griffin2015-10-201-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this commit, Rails makes no differentiation between whether a query uses bind parameters, and whether or not we cache that query as a prepared statement. This leads to the cache populating extremely fast in some cases, with the statements never being reused. In particular, the two problematic cases are `where(foo: [1, 2, 3])` and `where("foo = ?", 1)`. In both cases we'll end up quoting the values rather than using a bind param, causing a cache entry for every value ever used in that query. It was noted that we can probably eventually change `where("foo = ?", 1)` to use a bind param, which would resolve that case. Additionally, on PG we can change our generated query to be `WHERE foo = ANY($1)`, and pass an array for the bind param. I hope to accomplish both in the future. For SQLite and MySQL, we still end up preparing the statements anyway, we just don't cache it. The statement will be cleaned up after it is executed. On postgres, we skip the prepare step entirely, as an API is provided to execute with bind params without preparing the statement. I'm not 100% happy on the way this ended up being structured. I was hoping to use a decorator on the visitor, rather than mixing a module into the object, but the way Arel has it's visitor pattern set up makes it very difficult to extend without inheritance. I'd like to remove the duplication from the various places that are extending it, but that'll require a larger restructuring of that initialization logic. I'm going to take another look at the structure of it soon. This changes the signature of one of the adapter's internals, and will require downstream changes from third party adapters. I'm not too worried about this, as worst case they can simply add the parameter and always ignore it, and just keep their previous behavior. Fixes #21992.
* Wrong usage of 'a' in docs fixed [ci skip]Mehmet Emin İNAÇ2015-10-031-1/+1
|
* introduce `conn.data_source_exists?` and `conn.data_sources`.Yves Senn2015-09-221-0/+2
| | | | | | | | | | | | | | | | | These new methods are used from the Active Record model layer to determine which relations are viable to back a model. These new methods allow us to change `conn.tables` in the future to only return tables and no views. Same for `conn.table_exists?`. The goal is to provide the following introspection methods on the connection: * `tables` * `table_exists?` * `views` * `view_exists?` * `data_sources` (views + tables) * `data_source_exists?` (views + tables)
* Merge pull request #21609 from kamipo/do_not_dump_view_as_tableJeremy Daer2015-09-191-0/+13
|\ | | | | | | Do not dump a view as a table in sqlite3, mysql and mysql2 adapters