Browsing projects by Tag(s)

Select a tag to browse associated projects and drill deeper into the tag cloud.

Showing page 1 of 1

pdoext is a database abstraction layer for PHP5, based on PDO. It is by no means a full blown ORM, and should rather be seen as an extension of PDO. The library consists of three parts; The connection is a pre-requisite for the other two, but you could use the connection on its own. The main ... [More] component is the connection class. This extends from the main PDO class and adds some convenience methods as well as patching some bugs. The rest of the library consists of an object oriented query building API, similar to Hibernate's Criteria API. This allows an elegant way of constructing complex queries dynamically. There is also a simple table data gateway, for basic CRUD operations. The table gateway and the query api does not depend on each other, so you can use them separately. Below are some code samples, to give you an idea about the scope of the library: Query abstraction:Example 1: Simple select$db = new pdoext_Connection(...); $query = new pdoext_Query($db, "people"); $query->addCriterion("first_name", "John"); $db->query($query->toSQL());Results in: select * from `people` where `first_name` = 'John'Example 2: Select with a left join and various options$db = new pdoext_Connection(...); $query = new pdoext_Query($db, "people"); $query->addColumn("first_name"); $query->setLimit(10); $query->setOffset(10); $join = $query->addJoin("accounts", "LEFT JOIN"); $sub = $join->addCriterion(new pdoext_query_Criteria("OR")); $sub->addConstraint("people.account_id", "accounts.account_id"); $sub->addCriterion("people.account_id", 28, ">"); $query->addCriterion('first_name', "John"); $db->query($query->toSQL());Results in: select `first_name` from `people` left join `accounts` on `people`.`account_id` = `accounts`.`account_id` or `people`.`account_id` > '28' where `first_name` = 'John' limit 10 offset 10Table gateway:Assuming the following table: CREATE TABLE users ( id INTEGER, name VARCHAR(255) )Example 3: Insert a record$db = new pdoext_Connection(...); $users = new pdoext_TableGateway("users", $connection); $users->insert(array("id" => 42, "name" => "John"));The table now contains: id name 42 John Example 4: Update a record... $users->update(array("name" => "Jim"), array("id" => 42));The table now contains: id name 42 Jim Example 5: Fetch a single record... $record = $users->fetch(array("id" => 42));Returns: Array( 'id' => '42', 'name' => 'Jim' );Example 6: Delete a record... $users->delete(array("id" => 42));More examples in the test-suite: http://code.google.com/p/pdoext/source/browse/trunk/test/ [Less]

0
 
  0 reviews  |  0 users  |  1,169 lines of code  |  0 current contributors  |  Analyzed 4 days ago
 
 

IntroduçãoO projeto pSQLite é um query browser de bancos SQLite, com funcionalidades simples e funcionais, que visa facilitar a visualização e edição dos dados dos bancos de diferentes versões. Licença e CódigoDesenvolvido em PHP-GTK, o pSQLite pode rodar em qualquer sistema operacional ... [More] , e sob a BSD License, o software em questão pode ser utilizado e modificado por qualquer usuário, sem custo algum. ScreenshotsAbaixo segue alguns screenshots da versão para download [Less]

0
 
  0 reviews  |  0 users  |  1,104 lines of code  |  0 current contributors  |  Analyzed 6 days ago
 
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.