aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/sqlite3
Commit message (Collapse)AuthorAgeFilesLines
* Avoid using index_xinfo, only available in sqlite >= 3.8.9Paul Kuruvilla2017-10-251-9/+12
|
* Save index order :desc to schema.rb (sqlite). Fixes #30902Paul Kuruvilla2017-10-241-2/+9
| | | | | Although the sqlite adapter supports index sort orders, they weren't being written to db/schema.rb.
* Remove deprecated argument `name` from `#indexes`Rafael Mendonça França2017-10-231-7/+1
|
* Extract `integer_like_primary_key_type` to ease to handle it for adaptersRyuta Kamizono2017-09-251-6/+3
|
* Move integer-like primary key normalization to `new_column_definition`Ryuta Kamizono2017-09-232-19/+7
| | | | | | Currently the normalization only exists in `primary_key` shorthand. It should be moved to `new_column_definition` to also affect to `add_column` with primary key.
* Refactor `SchemaDumper` to make it possible to adapter specific customizationRyuta Kamizono2017-08-222-2/+5
| | | | | | | Currently `SchemaDumper` is only customizable for column options. But 3rd party connection adapters (oracle-enhanced etc) need to customizable for table or index dumping also. To make it possible, I introduced adapter specific `SchemaDumper` classes for that.
* Place `update_table_definition` consistently in `SchemaStatements`Ryuta Kamizono2017-08-211-0/+4
|
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-196-0/+12
|
* Change sqlite3 boolean serialization to use 1 and 0Lisa Ugray2017-07-111-0/+16
| | | | | | | | | | | | | | | | | | | | Abstract boolean serialization has been using 't' and 'f', with MySQL overriding that to use 1 and 0. This has the advantage that SQLite natively recognizes 1 and 0 as true and false, but does not natively recognize 't' and 'f'. This change in serialization requires a migration of stored boolean data for SQLite databases, so it's implemented behind a configuration flag whose default false value is deprecated. The flag itself can be deprecated in a future version of Rails. While loaded models will give the correct result for boolean columns without migrating old data, where() clauses will interact incorrectly with old data. While working in this area, also change the abstract adapter to use `"TRUE"` and `"FALSE"` as quoted values and `true` and `false` for unquoted. These are supported by PostreSQL, and MySQL remains overriden.
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-026-6/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-026-0/+6
|\ | | | | | | Enforce frozen string in Rubocop
| * Enforce frozen string in RubocopKir Shatrov2017-07-016-0/+6
| |
* | Merge pull request #29506 from pat/frozen-string-literalsMatthew Draper2017-07-021-1/+1
|\ \ | | | | | | | | | Make ActiveSupport frozen-string-literal friendly.
| * | Make ActiveRecord frozen string literal friendly.Pat Allan2017-06-201-1/+1
| |/
* / Don't cache queries for schema statementsRyuta Kamizono2017-06-301-1/+1
|/ | | | | | `test_middleware_caches` is sometimes failed since #29454. The failure is due to schema statements are affected by query caching. Bypassing query caching for schema statements to avoid the issue.
* Refactor `indexes` things in connection adaptersRyuta Kamizono2017-04-161-0/+35
| | | | | | | * Use keyword arguments in `IndexDefinition` to ease to ignore unused options and to avoid to initialize incorrect empty value. * Place it in `SchemaStatements` for consistency. * And tiny tweaks.
* Make internal methods to privateRyuta Kamizono2017-03-271-0/+25
|
* Extract `data_source_sql` to refactor data source statementsRyuta Kamizono2017-02-201-0/+32
|
* Merge pull request #26630 from kamipo/quoted_binaryRafael França2017-02-131-8/+4
|\ | | | | Extract `quoted_binary` and use it rather than override `_quote`
| * Extract `quoted_binary` and use it rather than override `_quote`Ryuta Kamizono2016-09-271-8/+4
| | | | | | | | | | | | | | Each databases have different binary representation. Therefore all adapters overrides `_quote` for quoting binary. Extract `quoted_binary` for quoting binary and use it rather than override `_quote`.
* | Refactor `ColumnDefinition` to contain `options` hashRyuta Kamizono2017-02-091-8/+1
| | | | | | | | | | | | Column options are passed as an hash args then used as `options` hash in `add_column_options!`. Converting args to attributes is inconvinient for using options as an hash.
* | `primary_key` and `references` columns should be identical typeRyuta Kamizono2017-02-071-0/+5
| | | | | | | | | | | | | | | | Follow up to #26266. The default type of `primary_key` and `references` were changed to `bigint` since #26266. But legacy migration and sqlite3 adapter should keep its previous behavior.
* | Correctly dump integer-like primary key with default nilRyuta Kamizono2017-02-041-1/+5
| | | | | | | | | | | | | | The PR #27384 changed integer-like primary key to be autoincrement unless an explicit default. This means that integer-like primary key is restored as autoincrement unless dumping the default nil explicitly. We should dump integer-like primary key with default nil correctly.
* | Tweak bigint PK handlingMatthew Draper2017-01-181-1/+1
| | | | | | | | | | | | * Don't force PKs on tables that have explicitly opted out * All integer-like PKs are autoincrement unless they have an explicit default
* | Merge pull request #27274 from kamipo/primary_key_with_auto_increment_and_bigintMatthew Draper2016-12-061-1/+1
|\ \ | | | | | | Make `:auto_increment` option works on `:bigint`
| * | Make `:auto_increment` option works on `:bigint`Ryuta Kamizono2016-12-061-1/+1
| | | | | | | | | | | | Follow up to #27272.
* | | Change MySQL and Postgresql to use Bigint primary keysJon McCartie2016-12-051-0/+13
|/ /
* / Make `:auto_increment` to internal primary key optionRyuta Kamizono2016-12-061-0/+23
|/ | | | | | Using `:auto_increment` option for abstracting the DB-specific auto incremental types. It is worth to ease to implement the compatibility layer.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-16/+16
|
* applies new string literal convention in activerecord/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* `@quoted_{column,table}_names` should cache a frozen stringRyuta Kamizono2016-07-281-1/+1
| | | | | | | | | | | | | | Caching a mutable string causes the following issue. ``` Loading development environment (Rails 5.1.0.alpha) irb(main):001:0> ActiveRecord::Base.connection.quote_table_name('foo') << '!!' => "`foo`!!" irb(main):002:0> ActiveRecord::Base.connection.quote_table_name('foo') << '!!' => "`foo`!!!!" irb(main):003:0> ActiveRecord::Base.connection.quote_table_name('foo') << '!!' => "`foo`!!!!!!" ```
* Merge pull request #23622 from kamipo/primary_key_should_be_not_nullJeremy Daer2016-04-181-0/+7
|\ | | | | | | Primary key should be `NOT NULL`
| * Primary key should be `NOT NULL`Ryuta Kamizono2016-03-121-0/+7
| | | | | | | | | | | | | | Follow up to #18228. In MySQL and PostgreSQL, primary key is to be `NOT NULL` implicitly. But in SQLite it must be specified `NOT NULL` explicitly.
* | Should keep quoting behaivor of a time column value in sqlite3 adapterRyuta Kamizono2016-04-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow up to #24542. In MySQL and PostgreSQL, a time column value is saved as ignored the date part of it. But in SQLite3, a time column value is saved as a string. We should keep previous quoting behavior in sqlite3 adapter. ``` sqlite> CREATE TABLE "foos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "start" time(0), "finish" time(4)); sqlite> INSERT INTO "foos" ("start", "finish") VALUES ('2000-01-01 12:30:00', '2000-01-01 12:30:00.999900'); sqlite> SELECT "foos".* FROM "foos"; 1|2000-01-01 12:30:00|2000-01-01 12:30:00.999900 sqlite> SELECT "foos".* FROM "foos" WHERE "foos"."start" = '2000-01-01 12:30:00' LIMIT 1; 1|2000-01-01 12:30:00|2000-01-01 12:30:00.999900 sqlite> SELECT "foos".* FROM "foos" WHERE "foos"."start" = '12:30:00' LIMIT 1; sqlite> ```
* | Move `quoted_date`, `quote_string` and `quote_table_name_for_assignment` ↵Ryuta Kamizono2016-04-051-0/+8
| | | | | | | | methods to `Quoting` module
* | Move `@quoted_{column|table}_names` cache up to the abstract adapterRyuta Kamizono2016-03-311-0/+4
| |
* | Make to private the visibility of `_quote` and `_type_cast`Ryuta Kamizono2016-03-301-0/+32
|/
* Extract `ExplainPrettyPrinter` to appropriate filesRyuta Kamizono2016-02-011-0/+19
|
* Add collation support for string and text columns in SQLite3Akshay Vishnoi2015-05-281-0/+15