Convert SQL query to Drupal Database abstraction layer code.
Dependencies:
INSTALL:
- Download and install Libraries API module
- Download PHP-SQL-Parser (version from 2013-11-30) library and unzip it to "sites/all/libraries" folder. Full path must be "sites/all/libraries/PHP-SQL-Parser/php-sql-parser.php"
- Download and install "Query coder" module
- Go to admin/config/development/query_coder
How To Use
Nice tutorial for this module on webwash.net:
Convert SQL Query Into Dynamic Query Using Query Coder Module
Known issues:
- INSERT queries must be specified in form "INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...)"
- Not support "->expression()" conditions for UPDATE queries.
- All tables and fields in SELECT query must be specified with aliases, in other (UPDATE, INSERT, DELETE) queries without aliases
Example:
RIGHT: "SELECT * FROM users u"
NOT RIGHT: "SELECT * FROM users" - All combining conditions in SELECT queries must be specified with aliases.
Example:
RIGHT: "SELECT COUNT(*) AS user_count FROM users u"
NOT RIGHT: "SELECT COUNT(*) FROM users u".
Supporting organizations:
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Developer tools
46 sites report using this module
- Created by denisz on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
