php-spark/plugins/com.noccy.pdo
Christopher Vagnetoft 538383c33d PDO plugin: Reflections
* com.noccy.pdo: Implemented reflection for PDO databases,
  tables and columns. Reflectors for MySQL and Sqlite.
* com.noccy.pdo: Added pdo:inspect command.
* com.noccy.docker: Added basic stack management and commands.
* com.noccy.docker: Moved commands to dedicated namespace.
* Environment: readConfig and writeConfig helper added, with
  a flag to use the global config dir ~/.config/spark.
2021-12-24 01:27:57 +01:00
..
Commands PDO plugin: Reflections 2021-12-24 01:27:57 +01:00
Reflection PDO plugin: Reflections 2021-12-24 01:27:57 +01:00
PdoResource.php PDO plugin: Reflections 2021-12-24 01:27:57 +01:00
README.md Misc fixes and improvements 2021-12-14 23:01:25 +01:00
sparkplug.php PDO plugin: Reflections 2021-12-24 01:27:57 +01:00

PDO Plugin

Usage

Storing queries:

$ spark pdo:store --res otherdb \  # store resource with query
    "getuserid" \  # Query name
    "select id from users where username=:username" \  # query
    :username  # slot

List stored queries:

$ spark pdo:store

Delete a stored query:

$ spark pdo:store --remove getuserid

Recalling queries:

$ spark pdo:query --recall getuserid username=bob

Direct query:

$ spark pdo:query "select * from users"
$ spark pdo:query --res otherdb "select * from users"
$ spark pdo:query --vertical "select * from user where id=:id" id=42
$ spark pdo:query --box --vertical "select name,value from config"