- 01 2月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 08 1月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Simply `{update|delete}_sql` aliases to `{update|delete}`.
-
- 07 1月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
`sql += " WHERE 1=1"` was introduced in 69cb942d. But it is not needed. ref https://www.sqlite.org/lang_delete.html
-
由 Ryuta Kamizono 提交于
`connection.insert_sql` is almost the same as `connection.insert`.
-
- 05 1月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
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.
-
- 01 12月, 2015 1 次提交
-
-
由 Yasuo Honda 提交于
-
- 30 11月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
`pool` in args is unused anymore. And `config` is used in all adapters.
-
- 09 11月, 2015 1 次提交
-
-
由 yui-knk 提交于
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?`.
-
- 03 11月, 2015 1 次提交
-
-
由 Yuki Nishijima 提交于
-
- 22 10月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
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.
-
- 21 10月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
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.
-
- 04 10月, 2015 1 次提交
-
-
由 Mehmet Emin İNAÇ 提交于
-
- 23 9月, 2015 1 次提交
-
-
由 Yves Senn 提交于
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)
-
- 20 9月, 2015 2 次提交
-
-
由 Ryuta Kamizono 提交于
Example: create_table :barcodes, primary_key: ["region", "code"] do |t| t.string :region t.integer :code end
-
由 Ryuta Kamizono 提交于
`@connection` in `StatementPool` is only used for PG adapter. No need for abstract `StatementPool` class.
-
- 13 9月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 06 9月, 2015 1 次提交
-
-
由 Grey Baker 提交于
See http://www.postgresql.org/docs/9.4/static/sql-dropindex.html for more details.
-
- 21 7月, 2015 1 次提交
-
-
由 Jori Hardman 提交于
-
- 27 6月, 2015 1 次提交
-
-
由 Prem Sichanugrist 提交于
Passing `:from` and `:to` to `change_column_default` makes this command reversible as user has defined its previous state. So, instead of having the migration command as: change_column_default(:posts, :state, "draft") They can write it as: change_column_default(:posts, :state, from: nil, to: "draft")
-
- 28 5月, 2015 1 次提交
-
-
由 Akshay Vishnoi 提交于
-
- 20 5月, 2015 2 次提交
-
-
由 Ryuta Kamizono 提交于
This line introduced by the commit fd398475 for using `Arel::Visitors::BindVisitor`. Currently it is not used.
-
由 Ryuta Kamizono 提交于
-
- 03 5月, 2015 1 次提交
-
-
由 Tony Miller 提交于
`change_column_null` is doc'ed only in ActiveRecord::ConnectionAdapters::SchemaStatements, so it would make sense to :nodoc: it elsewhere.
-
- 25 2月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
we do this in other adapters, and it's a nice speed improvement
-
- 12 2月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
As far as I can tell, the original reason that this behavior was added has been sufficiently resolved elsewhere, as we no longer remove the encoding of strings coming out of the database.
-
- 07 2月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
The same is not true of `define_attribute`, which is meant to be the low level no-magic API that sits underneath. The differences between the two APIs are: - `attribute` - Lazy (the attribute will be defined after the schema has loaded) - Allows either a type object or a symbol - `define_attribute` - Runs immediately (might get trampled by schema loading) - Requires a type object This was the last blocker in terms of public interface requirements originally discussed for this feature back in May. All the implementation blockers have been cleared, so this feature is probably ready for release (pending one more look-over by me).
-
- 04 2月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
The type from the column is never used, except when being passed to the attributes API. While leaving the type on the column wasn't necessarily a bad thing, I worry that it's existence there implies that it is something which should be used. During the design and implementation process of the attributes API, there have been plenty of cases where getting the "right" type object was hard, but I had easy access to the column objects. For any contributor who isn't intimately familiar with the intents behind the type casting system, grabbing the type from the column might easily seem like the "correct" thing to do. As such, the goal of this change is to express that the column is not something that should be used for type casting. The only places that are "valid" (at the time of this commit) uses of acquiring a type object from the column are fixtures (as the YAML file is going to mirror the database more closely than the AR object), and looking up the type during schema detection to pass to the attributes API Many of the failing tests were removed, as they've been made obsolete over the last year. All of the PG column tests were testing nothing beyond polymorphism. The Mysql2 tests were duplicating the mysql tests, since they now share a column class. The implementation is a little hairy, and slightly verbose, but it felt preferable to going back to 20 constructor options for the columns. If you are git blaming to figure out wtf I was thinking with them, and have a better idea, go for it. Just don't use a type object for this.
-
- 29 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
All columns which would map to a string primitive need this behavior. Binary has it's own marker type, so it won't go through this conversion. String and text, which need this, will. Fixes #18585.
-
- 28 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
`bound_attributes` is now used universally across the board, removing the need for the conversion layer. These changes are mostly mechanical, with the exception of the log subscriber. Additional, we had to implement `hash` on the attribute objects, so they could be used as a key for query caching.
-
- 24 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
Fixes #18580.
-
- 02 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
SQL has mechanisms we can use to copy data from one table into another.
-
- 31 12月, 2014 1 次提交
-
-
由 Arthur Neves 提交于
When table has a composite primary key, the `primary_key` method for sqlite3 and postgresql was only returning the first field of the key. Ensures that it will return nil instead, as AR dont support composite pks.
-
- 11 12月, 2014 1 次提交
-
-
由 Ryuta Kamizono 提交于
Move microseconds formatting to `AbstractAdapter`.
-
- 01 12月, 2014 1 次提交
-
-
由 Florian Weingarten 提交于
-
- 29 11月, 2014 1 次提交
-
-
由 Erik Michaels-Ober 提交于
-
- 25 11月, 2014 1 次提交
-
-
由 claudiob 提交于
Some comments that are meant to separate blocks of code in a file show up on http://api.rubyonrails.org as though they were part of the documentation. This commit hides those comments from the documentation. Stems from the discussion with @zzak at https://github.com/voloko/sdoc/issues/79#issuecomment-64158738 [ci skip]
-
- 11 11月, 2014 1 次提交
-
-
由 Andrey Deryabin 提交于
- remove unused method `supports_add_column?` - change additional restriction method to `valid_alter_table_type?` - fix code style
-
- 03 11月, 2014 1 次提交
-
-
由 Pablo Herrero 提交于
-
- 21 10月, 2014 1 次提交
-
-
由 claudiob 提交于
The `select` method has the same definition in almost all database adapters, so it can be moved from the database-specific adapters (PostgreSQl, MySQL, SQLite) to the abstract `database_statement`: ```ruby def select(sql, name = nil, binds = []) exec_query(sql, name, binds) end ``` --- More details about this commit: the only two DB-specific adapters that have a different definition of `select` are MySQLAdapter and MySQL2Adapter. In MySQLAdapter, `select` invokes `exec_query(sql, name, binds)`, so calling `super` achieves the same goal with less repetition. In MySQL2Adapter, `select` invokes `exec_query(sql, name)`, that is, it does not pass the `binds` parameter like other methods do. However, [MySQL2Adapter's `exec_query`](https://github.com/rails/rails/blob/74a527cc63ef56f3d0a42cf638299958dc7cb08c/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L228L231) works exactly the same whether this parameters is passed or not, so the output does not change: ```ruby def exec_query(sql, name = 'SQL', binds = []) result = execute(sql, name) ActiveRecord::Result.new(result.fields, result.to_a) end ```
-
- 09 9月, 2014 1 次提交
-
-
由 Yves Senn 提交于
`AbstractAdapter#supports_views?` defaults to `false` so we have to turn it on in adapter subclasses. Currently the flag only controls test execution. /cc @yahonda
-