• No results found

Dancer and DBIx::Class

N/A
N/A
Protected

Academic year: 2021

Share "Dancer and DBIx::Class"

Copied!
30
0
0

Loading.... (view fulltext now)

Full text

(1)

Dancer and DBIx::Class

Stefan Hornburg (Racke)

[email protected]

(2)

eCommerce Software

I Magento

(3)

Database Administration

I phpmyadmin

I phppgadmin

(4)

TableEditor Features

I Different database systems MySQL, PostgreSQL

I higher level of abstraction

I modern frontend

(5)

TableEditor

(6)

DBIx::Class without Dancer Plugin

use I n t e r c h a n g e 6 : : Schema ;

$schema = I n t e r c h a n g e 6 : : Schema

>connect( . . . ) ; $schema

> r e s u l t s e t ( ’ User ’ )

>search ( { . . } ) ;

(7)

DBIx::Class with Dancer Plugin

use Dancer : : P l u g i n : : DBIC ;

schema

> r e s u l t s e t ( ’ User ’ )

>search ( { . . } ) ; r e s u l t s e t ( ’ User ’ )

>search ( { . . } ) ;

(8)

Configuration

p l u g i n s : DBIC : d e f a u l t : dsn : d b i : mysql : i n t e r c h a n g e 6 user : ra ck e pass : n e v a i r b e schema_class : I n t e r c h a n g e 6 : : Schema

(9)

Multiple Schemas

p l u g i n s : DBIC : d e f a u l t : dsn : d b i : mysql : i n t e r c h a n g e 6 user : ra ck e pass : n e v a i r b e schema_class : I n t e r c h a n g e 6 : : Schema l e g a c y : dsn : d b i : mysql : i n t e r c h a n g e 5 user : ra ck e pass : n e v a i r b e schema_class : I n t e r c h a n g e 5 : : Schema

(10)

Multiple Schemas

use Dancer : : P l u g i n : : DBIC ;

(11)

UTF-8 for MySQL

p l u g i n s : DBIC : d e f a u l t : dsn : d b i : mysql : i n t e r c h a n g e 6 user : ra ck e pass : n e v a i r b e schema_class : I n t e r c h a n g e 6 : : Schema o p t i o n s : m y s q l _ e n a b l e _ u t f 8 : 1

(12)

Create schema dynamically

I

schema_class

missing in configuration

I DBIx::Class::Schema::Loader

I test and development

(13)

Overview Dancer::Session::DBIC

I configuration

I serialization

(14)

Engines

I Templates

TT, Xslate, Flute, ...

I Sessions

Storable, Database, DBIC

I Logger

File, Syslog

I Serializer

(15)

Configuration

session name of session engine (DBIC)

session_options options

(16)

Configuration

s e s s i o n : " DBIC " s e s s i o n _ o p t i o n s : dsn : d b i : mysql : i n t e r c h a n g e 6 user : ra ck e pass : n e v a i r b e schema_class : I n t e r c h a n g e 6 : : Schema r e s u l t s e t : Session id_column : s e s s i o n s _ i d data_column : s e s s i o n _ d a t a

(17)

Configuration

s e t s e s s i o n => ’ DBIC ’ ;

(18)

Example table

CREATE TABLE ‘ sessions ‘ (

‘ s e s s i o n s _ i d ‘ v a r c h a r ( 2 5 5 ) NOT NULL , ‘ s e s s i o n _ d a t a ‘ t e x t NOT NULL , ‘ c r e a t e d ‘ d a t e t i m e NOT NULL , ‘ l a s t _ m o d i f i e d ‘ d a t e t i m e NOT NULL , PRIMARY KEY ( ‘ s e s s i o n s _ i d ‘ ) ) ENGINE=InnoDB ;

(19)

Serializer

s e t ’ s e s s i o n _ o p t i o n s ’ => {

schema => schema ,

s e r i a l i z e r => sub { YAML : : Dump(@_) ; } , d e s e r i a l i z e r => sub { YAML : : Load (@_) ; } , } ;

(20)

Overview TableEditor

I Installation I Frontend I Login I Relationships I Limitations I Configuration

(21)

Installation

g i t c l o n e h t t p s : / / g i t h u b . com / i n t e r c h a n g e / T a b l e E d i t o r cd T a b l e E d i t o r

cpanm . . / b i n / app . p l

(22)

Driver

I DBD::mysql

I DBD::Pg

(23)

Frontend

I Angular

I Bootstrap

(24)

Login

I Dancer::Plugin::Auth::Extensible I Provider I Unix I DBIC I Database(planned)

(25)

Relationships

I might_have

I has_many

I belongs_to

(26)

Limitations

I Primary key foronecolumn only

I Speed (complex schemas)

(27)
(28)

Planned Features

I Search (Solr)

(29)

Development

(30)

Dancer2

Plugin::DBIC

https://metacpan.org/pod/Dancer2::

Plugin::DBIC

Session::DBIC not yet ported

References

Related documents

The content guidelines for differentiated instruction support the first UDL Teaching Method for recognition networks, provide multiple examples, in that they encourage the use

Use of the EN and Extensible Markup Language (XML) is considered the main data transfer process and format for submissions to the new emissions inventory system (referred to as

Regression plot of plant height estimated by the LiDAR sensor versus actual plant 286. height measured from digital

zabbix[wcache,values] :Values processed by Zabbix server per second..

This report describes fabrication of 100 to 200 nm diameter silicon nanopillars with ~140:1 aspect ratio using Metal Assisted Chemical Etching (MacEtch) process giving a high etch

Under constant factor loadings, a factor for non-agricultural real series (see Table 1) exhibits substantial postwar moderation in volatility, close to the reduction implied by

In this class, we will create a multi- page website first with HTML, then PHP - that connects to a MySQL database.. Introduction to Relational Database Management Systems (RDMS),

Five, nowadays frequently used database management systems (Apache Derby, Sun MySQL, Oracle Database, PostgreSQL, IBM DB2), four appli- cation servers (Apache Tomcat, Oracle