-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
mix ash_postgres.gen.resources
- Loading branch information
1 parent
133be50
commit efa4ef0
Showing
4 changed files
with
68 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
defmodule AshPostgres.RelWithParentFilterTest do | ||
use AshPostgres.RepoCase, async: false | ||
|
||
setup do | ||
AshPostgres.TestRepo.query!("DROP TABLE IF EXISTS example_table") | ||
AshPostgres.TestRepo.query!("CREATE TABLE example_table ( | ||
id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, | ||
name VARCHAR(255), | ||
age INTEGER, | ||
email VARCHAR(255) | ||
)") | ||
|
||
on_exit(fn -> | ||
AshPostgres.TestRepo.query!("DROP TABLE IF EXISTS example_table") | ||
end) | ||
end | ||
|
||
test "a resource is generated from a table" do | ||
Igniter.new() | ||
|> Igniter.compose_task("ash_postgres.gen.resources", [ | ||
"MyApp.Accounts", | ||
"--tables", | ||
"example_table", | ||
"--yes" | ||
]) | ||
end | ||
end |