kira🌺
kira🌺
AEAsh Elixir
Created by kira🌺 on 5/3/2025 in #support
`:read`ing random entry
much obliged for the help!
31 replies
AEAsh Elixir
Created by kira🌺 on 5/3/2025 in #support
`:read`ing random entry
where should i place validations block?
31 replies
AEAsh Elixir
Created by kira🌺 on 5/3/2025 in #support
`:read`ing random entry
it'll do the job until i add ids to my tables, thanks! considering the table situation, i see that i can add multiple DSL table attributes
sqlite do
table "quotes_en"
table "quotes_zh"
table "quotes_fr"
# ...

repo App.Repo
end
sqlite do
table "quotes_en"
table "quotes_zh"
table "quotes_fr"
# ...

repo App.Repo
end
and Ash queries from the last defined table. if i define an argument in my :random action like :lang, is it possible to choose table from which to query?
31 replies
AEAsh Elixir
Created by kira🌺 on 5/3/2025 in #support
`:read`ing random entry
so there's no option for uuid_primary_key/integer_primary_key [if i add one of them to my attributes list] to be like an abstract field? so Ash won't query it from my data layer?
31 replies
AEAsh Elixir
Created by kira🌺 on 5/3/2025 in #support
`:read`ing random entry
thanks! it works. now i need to somehow deal with the multiple tables situation. also API responses are a bit off - i need to return :text field inside "attributes", and not as id, but i don't have an 'id' column in my tables
{
"data": [
{
"attributes": {
// no text
"author": "Mother Teresa"
},
// here it is
"id": "Peace begins with a smile.",
"links": {},
"meta": {},
"type": "quote",
"relationships": {}
}
],
"links": {
"self": "http://localhost:4000/api/quote"
},
"meta": {},
"jsonapi": {
"version": "1.0"
}
}
{
"data": [
{
"attributes": {
// no text
"author": "Mother Teresa"
},
// here it is
"id": "Peace begins with a smile.",
"links": {},
"meta": {},
"type": "quote",
"relationships": {}
}
],
"links": {
"self": "http://localhost:4000/api/quote"
},
"meta": {},
"jsonapi": {
"version": "1.0"
}
}
31 replies