SlideShare a Scribd company logo
1 of 14
Download to read offline
Keires_DB


                  id:koyhoge



2010   10   3                  1
http://openpear.org/package/Keires_DB/


            2010-10-03 09:04 0.1.0-alpha




2010   10   3                                    2
about me

                •            (        )

                • id: koyhoge (   )

                •
                •

2010   10   3                             3
Keires_DB
                • O/R                          DB



                • PDO
                •
                  • late static binding, __callStatic
                  • PHP-5.3.0
2010   10   3                                           4
DB


                CREATE TABLE hogetbl (
                      col1    INTEGER PRIMARY KEY,
                      col2    TEXT,
                      col3    TIMESTAMP,
                      col4    BOOLEAN
                  );




2010   10   3                                        5
class DB_hoge extends Keires_DB_Abstract {
                    static public $table_name = 'hogetbl';
                    static public $tupple_info = array(
                        'col1' => array(
                            'type' => 'integer',
                            'primary' => true,
                            ),
                        'col2' => array(
                            'type' => 'text',
                            ),
                        'col3' => array(
                            'type' => 'timestamp',
                            ),
                        'col4' => array(
                            'type' => 'boolean',
                            ),
                        );
                }


2010   10   3                                                6
require_once 'Keires/DB.php';
       $options = array(
           'types' => array(
               'default' => array(
                   'dsn' =>
       'pgsql:host=localhost;user=koyama;dbname=koyama',
                   ),
               ),
           );
       Keires_DB::init($options);




2010   10   3                                              7
// store
                $data = array(
                    'col1' => 1,
                    'col2' => 'fugahoge',
                    'col3' => '2010-10-03 12:00:00',
                    'col4' => false,
                    );
                DB_hoge::store($data);

                // read
                $row = DB_hoge::getInfo(1);


2010   10   3                                          8
SQL

            class DB_hoge extends ...
                ....
                public static function findByCol2($val) {
                     $sql =
                         'SELECT * FROM ' . self::$table_name .
                         'WHERE col2=?';
                     $db = self::getImpl()->getDB();
                     return $db->getRow($sql, array($val));
                }
            }




2010   10   3                                                     9
•                     w

                • SQL
                •       PRIMARY KEY

                •       PRIMARY KEY



2010   10   3                             10
•   !

                •   DB

                •
                •   PostgreSQL



2010   10   3                    11
http://openpear.org/package/Keires_DB/


            2010-10-03 09:04 0.1.0-alpha




2010   10   3                                    12
FAQ
                Q: Keires     ?
                A:




                             Hecatonchires


2010   10   3                                13
http://bit.ly/keires_db




2010   10   3                             14

More Related Content

What's hot

Zf Zend Db by aida
Zf Zend Db by aidaZf Zend Db by aida
Zf Zend Db by aida
waraiotoko
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
Night Sailer
 
DrupalCamp Foz - Novas APIs Drupal 7
DrupalCamp Foz - Novas APIs Drupal 7DrupalCamp Foz - Novas APIs Drupal 7
DrupalCamp Foz - Novas APIs Drupal 7
chuvainc
 

What's hot (20)

How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data Objects
 
Zf Zend Db by aida
Zf Zend Db by aidaZf Zend Db by aida
Zf Zend Db by aida
 
[2019] 아직도 돈 주고 DB 쓰나요? for Developer
[2019] 아직도 돈 주고 DB 쓰나요? for Developer[2019] 아직도 돈 주고 DB 쓰나요? for Developer
[2019] 아직도 돈 주고 DB 쓰나요? for Developer
 
London XQuery Meetup: Querying the World (Web Scraping)
London XQuery Meetup: Querying the World (Web Scraping)London XQuery Meetup: Querying the World (Web Scraping)
London XQuery Meetup: Querying the World (Web Scraping)
 
与 PHP 和 Perl 使用 MySQL 数据库
与 PHP 和 Perl 使用 MySQL 数据库与 PHP 和 Perl 使用 MySQL 数据库
与 PHP 和 Perl 使用 MySQL 数据库
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
 
Native json in the Cache' ObjectScript 2016.*
Native json in the Cache' ObjectScript 2016.*Native json in the Cache' ObjectScript 2016.*
Native json in the Cache' ObjectScript 2016.*
 
PythonでJWT生成からボット作成、投稿までやってみた
PythonでJWT生成からボット作成、投稿までやってみたPythonでJWT生成からボット作成、投稿までやってみた
PythonでJWT生成からボット作成、投稿までやってみた
 
JSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFEJSON Schema in Web Frontend #insideFE
JSON Schema in Web Frontend #insideFE
 
jQuery Datatables With MongDb
jQuery Datatables With MongDbjQuery Datatables With MongDb
jQuery Datatables With MongDb
 
Object Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHPObject Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHP
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
 
Everyday's JS
Everyday's JSEveryday's JS
Everyday's JS
 
Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
 
DrupalCamp Foz - Novas APIs Drupal 7
DrupalCamp Foz - Novas APIs Drupal 7DrupalCamp Foz - Novas APIs Drupal 7
DrupalCamp Foz - Novas APIs Drupal 7
 
Your code sucks, let's fix it
Your code sucks, let's fix itYour code sucks, let's fix it
Your code sucks, let's fix it
 
Hidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeysHidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeys
 
Php
PhpPhp
Php
 
Uncovering Iterators
Uncovering IteratorsUncovering Iterators
Uncovering Iterators
 

Viewers also liked (8)

LL Planets告知
LL Planets告知LL Planets告知
LL Planets告知
 
PHP Frameworks with IPv6
PHP Frameworks with IPv6PHP Frameworks with IPv6
PHP Frameworks with IPv6
 
日本は世界一のITコミュニティ天国
日本は世界一のITコミュニティ天国日本は世界一のITコミュニティ天国
日本は世界一のITコミュニティ天国
 
The Widgetization Of Media by Futurist Gerd Leonhard (MIPCOM 2008)
The Widgetization Of Media by Futurist Gerd Leonhard (MIPCOM 2008)The Widgetization Of Media by Futurist Gerd Leonhard (MIPCOM 2008)
The Widgetization Of Media by Futurist Gerd Leonhard (MIPCOM 2008)
 
FuelPHPを3ヶ月使ってみて
FuelPHPを3ヶ月使ってみてFuelPHPを3ヶ月使ってみて
FuelPHPを3ヶ月使ってみて
 
まつりとTシャツと私
まつりとTシャツと私まつりとTシャツと私
まつりとTシャツと私
 
the History of LL events
the History of LL eventsthe History of LL events
the History of LL events
 
PHPプログラミングのIPv6対応の実際
PHPプログラミングのIPv6対応の実際PHPプログラミングのIPv6対応の実際
PHPプログラミングのIPv6対応の実際
 

Similar to Keires_DBリリースのご案内

Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Masahiro Nagano
 
ソーシャルアプリ向けシステム監視運用の勘所
ソーシャルアプリ向けシステム監視運用の勘所ソーシャルアプリ向けシステム監視運用の勘所
ソーシャルアプリ向けシステム監視運用の勘所
Tatsuro Hisamori
 
Spring dependency injection
Spring dependency injectionSpring dependency injection
Spring dependency injection
srmelody
 
Jooctrine - Doctrine ORM in Joomla!
Jooctrine - Doctrine ORM in Joomla!Jooctrine - Doctrine ORM in Joomla!
Jooctrine - Doctrine ORM in Joomla!
Herman Peeren
 

Similar to Keires_DBリリースのご案内 (20)

Ruby on Rails: Tasty Burgers
Ruby on Rails: Tasty BurgersRuby on Rails: Tasty Burgers
Ruby on Rails: Tasty Burgers
 
Rails and alternative ORMs
Rails and alternative ORMsRails and alternative ORMs
Rails and alternative ORMs
 
55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France
 
Using web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksUsing web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworks
 
Talkaboutlithium
TalkaboutlithiumTalkaboutlithium
Talkaboutlithium
 
Having Fun Programming!
Having Fun Programming!Having Fun Programming!
Having Fun Programming!
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
Drupal - dbtng 25th Anniversary Edition
Drupal - dbtng 25th Anniversary EditionDrupal - dbtng 25th Anniversary Edition
Drupal - dbtng 25th Anniversary Edition
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
 
Sequel
SequelSequel
Sequel
 
DEF CON 27 -OMER GULL - select code execution from using sq lite
DEF CON 27 -OMER GULL - select code execution from using sq liteDEF CON 27 -OMER GULL - select code execution from using sq lite
DEF CON 27 -OMER GULL - select code execution from using sq lite
 
Hidden Treasures of the Python Standard Library
Hidden Treasures of the Python Standard LibraryHidden Treasures of the Python Standard Library
Hidden Treasures of the Python Standard Library
 
Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017
 
DBD::SQLite
DBD::SQLiteDBD::SQLite
DBD::SQLite
 
Hibernate Inheritenc Mapping
Hibernate Inheritenc MappingHibernate Inheritenc Mapping
Hibernate Inheritenc Mapping
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
 
ソーシャルアプリ向けシステム監視運用の勘所
ソーシャルアプリ向けシステム監視運用の勘所ソーシャルアプリ向けシステム監視運用の勘所
ソーシャルアプリ向けシステム監視運用の勘所
 
Spring dependency injection
Spring dependency injectionSpring dependency injection
Spring dependency injection
 
Jooctrine - Doctrine ORM in Joomla!
Jooctrine - Doctrine ORM in Joomla!Jooctrine - Doctrine ORM in Joomla!
Jooctrine - Doctrine ORM in Joomla!
 
Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg Solutions
 

More from Tetsuji Koyama (8)

FuelPHP で DynamoDB
FuelPHP で DynamoDBFuelPHP で DynamoDB
FuelPHP で DynamoDB
 
LLまつりに行こう!
LLまつりに行こう!LLまつりに行こう!
LLまつりに行こう!
 
the Histrory of LT and ドラ娘
the Histrory of LT and ドラ娘the Histrory of LT and ドラ娘
the Histrory of LT and ドラ娘
 
IPv6の闇とPHP
IPv6の闇とPHPIPv6の闇とPHP
IPv6の闇とPHP
 
開発ライセンスとプログラマーの自由
開発ライセンスとプログラマーの自由開発ライセンスとプログラマーの自由
開発ライセンスとプログラマーの自由
 
PHPで使うIPv6の実際
PHPで使うIPv6の実際PHPで使うIPv6の実際
PHPで使うIPv6の実際
 
Traitsについて
TraitsについてTraitsについて
Traitsについて
 
ランダム文字ぽいものをつくる
ランダム文字ぽいものをつくるランダム文字ぽいものをつくる
ランダム文字ぽいものをつくる
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 

Keires_DBリリースのご案内

  • 1. Keires_DB id:koyhoge 2010 10 3 1
  • 2. http://openpear.org/package/Keires_DB/ 2010-10-03 09:04 0.1.0-alpha 2010 10 3 2
  • 3. about me • ( ) • id: koyhoge ( ) • • 2010 10 3 3
  • 4. Keires_DB • O/R DB • PDO • • late static binding, __callStatic • PHP-5.3.0 2010 10 3 4
  • 5. DB CREATE TABLE hogetbl ( col1 INTEGER PRIMARY KEY, col2 TEXT, col3 TIMESTAMP, col4 BOOLEAN ); 2010 10 3 5
  • 6. class DB_hoge extends Keires_DB_Abstract { static public $table_name = 'hogetbl'; static public $tupple_info = array( 'col1' => array( 'type' => 'integer', 'primary' => true, ), 'col2' => array( 'type' => 'text', ), 'col3' => array( 'type' => 'timestamp', ), 'col4' => array( 'type' => 'boolean', ), ); } 2010 10 3 6
  • 7. require_once 'Keires/DB.php'; $options = array( 'types' => array( 'default' => array( 'dsn' => 'pgsql:host=localhost;user=koyama;dbname=koyama', ), ), ); Keires_DB::init($options); 2010 10 3 7
  • 8. // store $data = array( 'col1' => 1, 'col2' => 'fugahoge', 'col3' => '2010-10-03 12:00:00', 'col4' => false, ); DB_hoge::store($data); // read $row = DB_hoge::getInfo(1); 2010 10 3 8
  • 9. SQL class DB_hoge extends ... .... public static function findByCol2($val) { $sql = 'SELECT * FROM ' . self::$table_name . 'WHERE col2=?'; $db = self::getImpl()->getDB(); return $db->getRow($sql, array($val)); } } 2010 10 3 9
  • 10. w • SQL • PRIMARY KEY • PRIMARY KEY 2010 10 3 10
  • 11. ! • DB • • PostgreSQL 2010 10 3 11
  • 12. http://openpear.org/package/Keires_DB/ 2010-10-03 09:04 0.1.0-alpha 2010 10 3 12
  • 13. FAQ Q: Keires ? A: Hecatonchires 2010 10 3 13