Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.
/ VueSQL Public archive

[ABANDONED PROJECT] Simple yet powerful library for building modern SQL queries from Skyfire.

Notifications You must be signed in to change notification settings

travisfont/VueSQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VueSQL

VueSQL is a PHP SQL library providing an easy and fluent integration of normal SQL syntax into PHP strings.

This library is originally part of Skyfire's PHP framework database layer known as VueSQL service.

Requirements

  • PHP >=5.3.6+
  • PDO_MYSQL PHP extensions

Code Examples

Establishing a connection (required):

require 'src/VueSQL.php';

$conn = array
(
    'host'     => 'localhost',
    'dbname'   => 'test',
    'user'     => 'root',
    'password' => '*******'
);

Simple select query:

$SQL   = new VueSQL($conn);

$query = $SQL->SELECT('r.rid, r.name')
             ->FROM('test')
             ->WHERE('id', '>', 0)
             ->ORDER_BY('r.weight')->ASC();
             
echo $query->exe();

Simple alternation (change) on a table:

$add   = new VueSQL($conn);

$query = $add->ALTER_TABLE('xml_mapping')
             ->CHANGE('special_rule')
             ->ENUM('meta_value_default',
                    'convert_boolean',
                    'multiple_value_terms')
             ->CHARACTER_SET('utf8')
             ->COLLATE('utf8_general_ci')
             ->NULL();
              
echo $query->exe();

License

VueSQL is licensed under the MIT License.

Copyright 2016 Travis van der Font

About

[ABANDONED PROJECT] Simple yet powerful library for building modern SQL queries from Skyfire.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages