Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration_test/sql/alter.exs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ defmodule Ecto.Integration.AlterTest do
assert :ok == run(:down, PoolRepo, AlterMigrationOne)
end

test "reset cache on parameterised query after alter column type" do
test "reset cache on parameterized query after alter column type" do
values = from v in "alter_col_type"

assert :ok == run(:up, PoolRepo, AlterMigrationOne)
Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/adapters/sql.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ defmodule Ecto.Adapters.SQL do
* `mix ecto.migrate` - runs a migration
* `mix ecto.rollback` - rolls back a previously run migration

If you want to run migrations programatically, see `Ecto.Migrator`.
If you want to run migrations programmatically, see `Ecto.Migrator`.

## SQL sandbox

Expand Down
8 changes: 4 additions & 4 deletions lib/ecto/adapters/tds.ex
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ defmodule Ecto.Adapters.Tds do

### UUIDs

MSSQL server has slightly different binary storage format for UUIDs (`uniqueidenitifer`).
MSSQL server has slightly different binary storage format for UUIDs (`uniqueidentifier`).
If you use `:binary_id`, the proper choice is made. Otherwise you must use the `Tds.Ecto.UUID`
type. Avoid using `Ecto.UUID` since it may cause unpredictable application behaviour.

Expand All @@ -75,9 +75,9 @@ defmodule Ecto.Adapters.Tds do
codepage.

- If you need other than Latin1 or other than your database default collation, as
mentioned in "Storage Options" section, then manualy encode strings using
mentioned in "Storage Options" section, then manually encode strings using
`Tds.Encoding.encode/2` into desired codepage and then tag parameter as `:binary`.
Please be aware that queries that use this approach in where calues can be 10x slower
Please be aware that queries that use this approach in where clauses can be 10x slower
due increased logical reads in database.

- You can't store VarChar codepoints encoded in one collation/codepage to column that
Expand Down Expand Up @@ -123,7 +123,7 @@ defmodule Ecto.Adapters.Tds do
Ecto.Adapter.SQL.query("SET TRANSACTION ISOLATION LEVEL XYZ")

will fail once explicit transaction is started using `c:Ecto.Repo.transaction/2`
and reset back to :read_commited.
and reset back to :read_committed.

There is `Ecto.Query.lock/3` function can help by setting it to `WITH(NOLOCK)`.
This should allow you to do eventually consistent reads and avoid locks on given
Expand Down
12 changes: 6 additions & 6 deletions lib/ecto/adapters/tds/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ if Code.ensure_loaded?(Tds) do
Enum.map_join(fields, ", ", &"#{name}.#{quote_name(&1)}")
end

# eaxmple from {:in, [], [1, {:^, [], [0, 0]}]}
# example from {:in, [], [1, {:^, [], [0, 0]}]}
defp expr({:in, _, [_left, []]}, _sources, _query) do
"0=1"
end
Expand Down Expand Up @@ -806,7 +806,7 @@ if Code.ensure_loaded?(Tds) do
end

defp expr(%Decimal{exp: exp} = decimal, _sources, _query) do
# this should help gaining precision for decimals values embeded in query
# this should help gaining precision for decimals values embedded in query
# but this is still not good enough, for instance:
#
# from(p in Post, select: type(2.0 + ^"2", p.cost())))
Expand All @@ -819,7 +819,7 @@ if Code.ensure_loaded?(Tds) do
# FROM [posts] AS p0
#
# as long as we have CAST(... as DECIMAL) without precision and scale
# value could be trucated
# value could be truncated
[
"CAST(",
Decimal.to_string(decimal, :normal),
Expand Down Expand Up @@ -1478,7 +1478,7 @@ if Code.ensure_loaded?(Tds) do

defp quote_name(name) do
if String.contains?(name, ["[", "]"]) do
error!(nil, "bad field name #{inspect(name)} '[' and ']' are not permited")
error!(nil, "bad field name #{inspect(name)} '[' and ']' are not permitted")
end

"[#{name}]"
Expand All @@ -1501,7 +1501,7 @@ if Code.ensure_loaded?(Tds) do

defp quote_table(name) do
if String.contains?(name, "[") or String.contains?(name, "]") do
error!(nil, "bad table name #{inspect(name)} '[' and ']' are not permited")
error!(nil, "bad table name #{inspect(name)} '[' and ']' are not permitted")
end

"[#{name}]"
Expand All @@ -1523,7 +1523,7 @@ if Code.ensure_loaded?(Tds) do

defp unquoted_name(name) do
if String.contains?(name, ["[", "]"]) do
error!(nil, "bad table name #{inspect(name)} '[' and ']' are not permited")
error!(nil, "bad table name #{inspect(name)} '[' and ']' are not permitted")
end

name
Expand Down
4 changes: 2 additions & 2 deletions lib/ecto/adapters/tds/types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if Code.ensure_loaded?(Tds) do
@type t :: <<_::288>>

@typedoc """
A raw binary represenation of a UUID.
A raw binary representation of a UUID.
"""
@type raw :: <<_::128>>

Expand Down Expand Up @@ -233,7 +233,7 @@ if Code.ensure_loaded?(Tds) do
Please be aware of this limitation if you plan to store varchar values in
your database using Ecto since you will probably lose some codepoints in
the value during encoding. Instead use `tds_encoding` library and first
encode value and then anotate it as `:binary` by calling `Ecto.Query.API.type/2`
encode value and then annotate it as `:binary` by calling `Ecto.Query.API.type/2`
in your query. This way all codepoints will be properly preserved during
insert to database.
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/ecto.dump.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defmodule Mix.Tasks.Ecto.Dump do
* `-d`, `--dump-path` - the path of the dump file to create
* `-q`, `--quiet` - run the command quietly
* `--no-compile` - does not compile applications before dumping
* `--no-deps-check` - does not check depedendencies before dumping
* `--no-deps-check` - does not check dependencies before dumping
"""

@impl true
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/ecto.gen.migration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ defmodule Mix.Tasks.Ecto.Gen.Migration do

* `-r`, `--repo` - the repo to generate migration for
* `--no-compile` - does not compile applications before running
* `--no-deps-check` - does not check depedendencies before running
* `--no-deps-check` - does not check dependencies before running
* `--migrations-path` - the path to run the migrations from, defaults to `priv/repo/migrations`

## Configuration
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/ecto.load.ex
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ defmodule Mix.Tasks.Ecto.Load do
Configuration is asked only when `:start_permanent` is set to true
(typically in production)
* `--no-compile` - does not compile applications before loading
* `--no-deps-check` - does not check depedendencies before loading
* `--no-deps-check` - does not check dependencies before loading
* `--skip-if-loaded` - does not load the dump file if the repo has the migrations table up
"""

Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/ecto.migrate.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ defmodule Mix.Tasks.Ecto.Migrate do

* `--no-compile` - does not compile applications before migrating

* `--no-deps-check` - does not check depedendencies before migrating
* `--no-deps-check` - does not check dependencies before migrating

* `--migrations-path` - the path to load the migrations from, defaults to
`"priv/repo/migrations"`. This option may be given multiple times in which case the migrations
Expand Down
6 changes: 3 additions & 3 deletions lib/mix/tasks/ecto.rollback.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ defmodule Mix.Tasks.Ecto.Rollback do
config :my_app, MyApp.Repo, priv: "priv/custom_repo"

This task rolls back the last applied migration by default. To roll
back to a version number, supply `--to version_number`. To roll
back a specific number of times, use `--step n`. To undo all applied
back to a version number, supply `--to version_number`. To roll
back a specific number of times, use `--step n`. To undo all applied
migrations, provide `--all`.

The repositories to rollback are the ones specified under the
Expand Down Expand Up @@ -82,7 +82,7 @@ defmodule Mix.Tasks.Ecto.Rollback do

* `--no-compile` - does not compile applications before rolling back

* `--no-deps-check` - does not check depedendencies before rolling back
* `--no-deps-check` - does not check dependencies before rolling back

* `--migrations-path` - the path to load the migrations from, defaults to
`"priv/repo/migrations"`. This option may be given multiple times in which case the migrations
Expand Down