Keires_DBリリースのご案内

  • 707 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
707
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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
  • 14. http://bit.ly/keires_db 2010 10 3 14