Skip to content

Commit 0994310

Browse files
committed
chore: more literal -> identifier
1 parent db2d60d commit 0994310

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

documentation/topics/advanced/manual-relationships.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ defmodule MyApp.Employee.ManagedEmployees do
240240
employee_keys = Employee.__schema__(:fields)
241241

242242
cte_name_ref =
243-
from(cte in fragment("?", literal(^cte_name)), select: map(cte, ^employee_keys))
243+
from(cte in fragment("?", identifier(^cte_name)), select: map(cte, ^employee_keys))
244244

245245
recursion_query =
246246
query

lib/data_layer.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,7 +2109,7 @@ defmodule AshPostgres.DataLayer do
21092109
|> Enum.map(fn upsert_field ->
21102110
# for safety, we check once more at the end that all values in
21112111
# upsert_fields are names of attributes. This is because
2112-
# below we use `literal/1` to bring them into the query
2112+
# below we use `identifier/1` to bring them into the query
21132113
if is_nil(resource.__schema__(:type, upsert_field)) do
21142114
raise "Only attribute names can be used in upsert_fields"
21152115
end
@@ -2122,7 +2122,7 @@ defmodule AshPostgres.DataLayer do
21222122
[],
21232123
fragment(
21242124
"COALESCE(EXCLUDED.?, ?)",
2125-
literal(^to_string(get_source_for_upsert_field(upsert_field, resource))),
2125+
identifier(^to_string(get_source_for_upsert_field(upsert_field, resource))),
21262126
^default
21272127
)
21282128
)}
@@ -2136,7 +2136,7 @@ defmodule AshPostgres.DataLayer do
21362136
[],
21372137
fragment(
21382138
"EXCLUDED.?",
2139-
literal(^to_string(get_source_for_upsert_field(upsert_field, resource)))
2139+
identifier(^to_string(get_source_for_upsert_field(upsert_field, resource)))
21402140
)
21412141
)}
21422142
end

lib/sql_implementation.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ defmodule AshPostgres.SqlImplementation do
5656
[],
5757
fragment(
5858
"EXCLUDED.?",
59-
literal(
59+
identifier(
6060
^to_string(
6161
AshPostgres.DataLayer.get_source_for_upsert_field(
6262
attribute,

mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ defmodule AshPostgres.MixProject do
169169
{:ash, ash_version("~> 3.5 and >= 3.5.13")},
170170
{:ash_sql, ash_sql_version("~> 0.2 and >= 0.2.72")},
171171
{:igniter, "~> 0.6", optional: true},
172-
{:ecto_sql, "~> 3.12"},
173-
{:ecto, "~> 3.12 and >= 3.12.1"},
172+
{:ecto_sql, "~> 3.13"},
173+
{:ecto, "~> 3.13"},
174174
{:jason, "~> 1.0"},
175175
{:postgrex, ">= 0.0.0"},
176176
# dev/test dependencies

mix.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
1010
"dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
1111
"earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"},
12-
"ecto": {:hex, :ecto, "3.12.6", "8bf762dc5b87d85b7aca7ad5fe31ef8142a84cea473a3381eb933bd925751300", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4c0cba01795463eebbcd9e4b5ef53c1ee8e68b9c482baef2a80de5a61e7a57fe"},
12+
"ecto": {:hex, :ecto, "3.13.0", "7528ef4f3a4cdcfebeb7eb6545806c8109529b385a69f701fc3d77b5b8bde6e7", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "061f095f1cc097f71f743b500affc792d6869df22b1946a73ab5495eb9b4a280"},
1313
"ecto_dev_logger": {:hex, :ecto_dev_logger, "0.14.1", "af385ce1af1c4210ad67a4c46b985c370713446a179144a1da2885138c9fb242", [:mix], [{:ecto, "~> 3.7", [hex: :ecto, repo: "hexpm", optional: false]}, {:geo, "~> 3.5 or ~> 4.0", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "14a64ebae728b3c45db6ba8bb185979c8e01fc1b0d3d1d9c01c7a2b798e8c698"},
14-
"ecto_sql": {:hex, :ecto_sql, "3.12.1", "c0d0d60e85d9ff4631f12bafa454bc392ce8b9ec83531a412c12a0d415a3a4d0", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aff5b958a899762c5f09028c847569f7dfb9cc9d63bdb8133bff8a5546de6bf5"},
14+
"ecto_sql": {:hex, :ecto_sql, "3.13.0", "a732428f38ce86612a2c34a1ea5d0a9642a5a71f044052007fd2f2e815707990", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.13.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5ce13085122a0871d93ea9ba1a886447d89c07f3b563e19e0b3dcdf201ed9fe9"},
1515
"eflame": {:hex, :eflame, "1.0.1", "0664d287e39eef3c413749254b3af5f4f8b00be71c1af67d325331c4890be0fc", [:mix], [], "hexpm", "e0b08854a66f9013129de0b008488f3411ae9b69b902187837f994d7a99cf04e"},
1616
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
1717
"ets": {:hex, :ets, "0.9.0", "79c6a6c205436780486f72d84230c6cba2f8a9920456750ddd1e47389107d5fd", [:mix], [], "hexpm", "2861fdfb04bcaeff370f1a5904eec864f0a56dcfebe5921ea9aadf2a481c822b"},

0 commit comments

Comments
 (0)