-
-
22 Nov 2021 22:52:12 UTC
- Distribution: RapidApp
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (63 / 0 / 1)
- Kwalitee
Bus factor: 2- % Coverage
- License: perl_5
- Perl: v5.10.0
- Activity
24 month- Tools
- Download (2.29MB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 14 contributors-
Michael Conrad
-
Torsten Raudssus
-
Peter Rabbitson
-
Deven T. Corzine
-
Roy Tate
-
Nicholas Foos
-
Michael Lackhoff
-
Tom Bloor
-
Matt S. Trout
-
Scott Walters
-
Tim Bunce
-
Dagfinn Ilmari Mannsåker
-
Roman Pavlov
-
James Wright
- Dependencies
- Alien::Web::ExtJS::V3
- Attribute::Handlers
- B::Deparse
- CHI
- Carp
- Carp::Clan
- Catalyst::Action::RenderView
- Catalyst::Authentication::Store::DBIx::Class
- Catalyst::Component::ApplicationAttribute
- Catalyst::Controller
- Catalyst::Controller::AutoAssets
- Catalyst::Controller::SimpleCAS
- Catalyst::Devel
- Catalyst::Helper
- Catalyst::Helper::Model::DBIC::Schema
- Catalyst::Model
- Catalyst::Model::DBIC::Schema
- Catalyst::Plugin::Authorization::Roles
- Catalyst::Plugin::AutoAssets
- Catalyst::Plugin::Session::State::Cookie
- Catalyst::Plugin::Session::Store::DBIC
- Catalyst::Plugin::SimpleCAS
- Catalyst::Runtime
- Catalyst::ScriptRunner
- Catalyst::Test
- Catalyst::Utils
- Catalyst::View
- Catalyst::View::TT
- CatalystX::AppBuilder
- CatalystX::InjectComponent
- Class::Load
- Class::MOP::Class
- Clone
- Clone::PP
- DBD::SQLite
- DBI
- DBI::Const::GetInfoType
- DBIx::Class
- DBIx::Class::Core
- DBIx::Class::Helper::ResultSet::Util
- DBIx::Class::Helpers
- DBIx::Class::InflateColumn::Authen::Passphrase
- DBIx::Class::Optional::Dependencies
- DBIx::Class::ResultSet
- DBIx::Class::Schema
- DBIx::Class::Schema::Diff
- DBIx::Class::Schema::Loader
- DBIx::Class::Schema::Loader::DBI
- DBIx::Class::Schema::Loader::Table
- Data::Dumper
- Data::Dumper::Concise
- Data::Printer
- DateTime
- DateTime::Format::SQLite
- Digest::MD5
- Digest::SHA1
- Excel::Writer::XLSX
- Exporter
- File::Copy::Recursive
- File::ShareDir
- File::Spec
- File::Temp
- FindBin
- Getopt::Long
- HTML::Entities
- HTML::Parser
- HTML::TokeParser::Simple
- HTTP::Request::Common
- IPC::Cmd
- Import::Into
- JSON
- JSON::PP
- LWP::UserAgent
- List::MoreUtils
- List::Util
- MIME::Base64
- Module::Locate
- Module::Runtime
- Moo
- Moo::Role
- Moose
- Moose::Role
- Moose::Util::TypeConstraints
- MooseX::MarkAsMethods
- MooseX::NonMoose
- MooseX::Traits
- PPI
- Path::Class
- Perl::Tidy
- Plack
- Plack::Builder
- Plack::Component
- Plack::Middleware
- Plack::Runner
- Pod::Find
- Pod::Parser
- Pod::Usage
- SQL::Abstract
- SQL::Translator
- Scalar::Util
- Spreadsheet::ParseExcel
- Spreadsheet::ParseExcel::Utility
- Storable
- String::CamelCase
- String::Random
- Sub::Name
- Template
- Template::Context
- Template::Provider
- Term::ANSIColor
- Text::CSV
- Text::Glob
- Text::Markdown
- Text::SimpleTable::AutoWidth
- Text::TabularDisplay
- Text::WagnerFischer
- Tie::IxHash
- Time::HiRes
- Try::Tiny
- Type::Tiny
- Types::Standard
- URI
- URI::Escape
- autodie
- base
- bytes
- curry
- integer
- lib
- mro
- namespace::autoclean
- namespace::clean
- overload
- parent
- strict
- vars
- warnings
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Plack::App::RapidApp::rDbic - Instant database CRUD using RapidApp
SYNOPSIS
use Plack::App::RapidApp::rDbic; $app = Plack::App::RapidApp::rDbic->new({ connect_info => { dsn => 'dbi:SQLite:my_sqlt.db', user => '', password => '' } })->to_app; # Or, for an existing schema class: $app = Plack::App::RapidApp::rDbic->new({ schema_class => 'My::Schema', connect_info => { dsn => 'dbi:SQLite:my_sqlt.db', user => '', password => '' } })->to_app; # For an existing schema connection: my $schema = My::Schema->connect('dbi:SQLite:my_sqlt.db'); $app = Plack::App::RapidApp::rDbic->new({ schema => $schema })->to_app;
DESCRIPTION
This module provides a Plack interface to a runtime-generated database CRUD application. It bootstraps and loads a fully working RapidApp application with a RapidDbic configuration for an arbitrary database, which can be supplied as either an existing DBIx::Class::Schema or a simple DBI connect string (dsn) to have DBIx::Class schema classes generated for you.
This module is used internally by rdbic.pl which exposes only a portion of the available options as a command-line script.
CONFIGURATION
connect_info
Your connect_info args normalized to hashref form (with dsn/user/password.) See "connect_info" in DBIx::Class::Storage::DBI for more info on the hashref form of "connect_info".
dsn
Alternative way to supply
connect_info
, as a string. The database user and password can be optionally inlined using commas.For example:
dsn => 'dbi:mysql:mydb,dbuser,dbpass'
Is equivalent to:
connect_info => ['dbi:mysql:mydb','dbuser','dbpass']
Is equivelent to:
connect_info => { dsn => 'dbi:mysql:mydb', user => 'dbuser', password => 'dbpass' }
schema_class
Optional existing DBIx::Class::Schema class name. Leave unconfigured to have the schema classes generated on-the-fly using DBIx::Class::Schema::Loader.
schema
Optional alternative existing/connected schema object. This option can be used instead of
connect_info
/schema_class
.app_namespace
Name of the generated RapidApp/Catalyst app. Defaults to
rDbicApp
. When multiple instances are loaded, subsequent names are generated asrDbicApp1
,rDbicApp2
and so on.crud_profile
One of five choices to broadly control CRUD interface behavior:
- editable
-
Default
Full CRUD is enabled with 'persist_immediately' turned off globally which means the user has to click "Save" to apply queued-up changes
- edit-instant
-
Full CRUD is enabled with 'persist_immediately' turned on. Changes are applied as soon as the cell is blurred after making a change
- edit-gridadd
-
Same as 'editable' except new rows are added directly to the grid instead of displaying an add record form
- ed-inst-gridadd
-
Same as 'edit-instant' except new rows are added directly to the grid; "Save" must still be clicked before the row is actually inserted
- read-only
-
No create/update/delete interfaces at all (rapidapp.pl default)
For more fine-grained control, RapidDbic configs can also be applied in
model_config
.no_cleanup
Set to true to prevent the temp
workdir
from being cleaned up on exit (ignored whenworkdir
is manually configured).Defaults to false.
tmpdir
Parent temporary directory. Defaults to
tmpdir
from File::Spec (usually/tmp/
)workdir
Directory in which to generate temporary application files. If left unconfigured, this is an automatically generated directory
'rdbic-tmp-XXXXX'
withintmpdir
which is automatically cleaned/removed unlessno_cleanup
is true.isolate_app_tmp
Set to true to override the location used for Catalyst temporary files to be contained within the
workdir
instead of within the system temp. This is useful to avoid leaving temporary files behind, but will slow startup because the asset files will be generated on each load.Defaults to false, but set to true in the rdbic.pl script.
local_tmp
Directory to use for
app_tmp
whenisolate_app_tmp
is true. Defaults totmp/
within theworkdir
model_name
Name of the
Model::DBIC
in the generated app. Defaults to an auto-generated name based on the schema/dsnmodel_config
Optional extra config to apply to the
Model::DBIC
in the generated app. This is useful to be able to customize RapidDbic configs (See Catalyst::Plugin::RapidApp::RapidDbic)METHODS
to_app
PSGI
$app
CodeRef. Derives from Plack::Componentmodel_class
Full class name of the
Model::DBIC
in the generated app.app_dir
Home directory for the generated RapidApp/Catalyst app. This will be the app name within the
workdir
app_tmp
The temporary directory used by the generated RapidApp/Catalyst app. If
isolate_app_tmp
is true this will be within theworkdir
, or whatever directory is set inlocal_tmp
. Otherwise it is the standard location returned byCatalyst::Utils::class2tempdir
for the generated app (which is not cleaned up).loader_options
Optional ArrayRef of loader_options which will be passed to the Schema::Loader. These should be supplied as a list of name=value pairs, for example:
loader_options => [qw/db_schema='%' generate_pod=1/]
This has the same effect as
-o
options supplied to dbicdump. For a complete list of suported options, see DBIx::Class::Schema::Loader::Base.connect_options
Optional ArrayRef of connect_options to be added to the
%extra_attributes
of theconnect_info
. (See "connect_info" in DBIx::Class::Storage::DBI). Likeloader_options
, these should be supplied as a list of name=value pairs, for example:connect_options => [qw/quote_names=0 mysql_enable_utf8=0/]
Note: the options in the above example are both set to
'1'
by default (second only for MySQL). So the above example is how you would go about turning these options off if needed for some reason.total_counts_off
If set to true, grids will be initialized with the total count turned off (but they can still be turned back on). Defaults to false (0)
SEE ALSO
AUTHOR
Henry Van Styn <vanstyn@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by IntelliTree Solutions llc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install RapidApp, copy and paste the appropriate command in to your terminal.
cpanm RapidApp
perl -MCPAN -e shell install RapidApp
For more information on module installation, please visit the detailed CPAN module installation guide.