Generates starter Ash Resource modules for AshScylla.
Summary
Functions
Parses generator command arguments.
Renders CQL CREATE TABLE and CREATE INDEX statements for a table.
Renders an Ash Resource template as a string.
Returns the generated resource file path for a resource name.
Writes a generated resource file to lib/<app>/resources/<resource>.ex.
Functions
Parses generator command arguments.
Example
AshScylla.ResourceGenerator.parse_args([
"MyResource",
"user_id:uuid, name:string, age:int"
])
Renders CQL CREATE TABLE and CREATE INDEX statements for a table.
Returns a list of CQL statement strings.
Renders an Ash Resource template as a string.
Options
:repo_module- The repo module to reference (defaults to<AppName>.Repo)
Example
AshScylla.ResourceGenerator.render_resource(
MyApp.User,
[user_id: :uuid, name: :string, age: :integer],
repo_module: MyApp.Repo
)
Returns the generated resource file path for a resource name.
Writes a generated resource file to lib/<app>/resources/<resource>.ex.