-
Notifications
You must be signed in to change notification settings - Fork 0
Dynamic create models for mojolicious.
License
h15/mojo_m
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
NAME MojoM - Mojo Models. OVERVIEW MojoM - easy model system for Mojolicious. It makes dynamic Rose::DB models in temporary dirrectory, after that it uses them. MojoM provides helper "model" to set current model, init for setup table params, get to load accounts form table and return Rose::DB::Object. EXAMPLE package MojoM; use Mojo::Base 'Mojolicious'; # This method will run once at server start sub startup { my $self = shift; $self->plugin ( 'mojo_m' => { driver => 'mysql', database => 'MojoM', host => 'localhost', username => 'MojoM', password => 'MojoM', } ); $self->model('User')->init ( table => 'users', columns => [ id => { type => 'serial' , not_null => 1 }, ... ], pk_columns => 'id' ); my $user = $self->model('User')->get( id => 1 ); print $user->name; } 1; COPYRIGHT AND LICENSE Copyright (C) 2011, Georgy Bazhukov. This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
About
Dynamic create models for mojolicious.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published