diff --git a/.gitignore b/.gitignore index fa2b677..881ef1c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ .DS_Store .*.sw? .idea +/nbproject/private/ +nbproject/ diff --git a/src/Firebird/Query/Processors/FirebirdProcessor.php b/src/Firebird/Query/Processors/FirebirdProcessor.php index c114ca8..b28212b 100644 --- a/src/Firebird/Query/Processors/FirebirdProcessor.php +++ b/src/Firebird/Query/Processors/FirebirdProcessor.php @@ -4,4 +4,18 @@ class FirebirdProcessor extends Processor { + /** + * Process the results of a column listing query. + * + * @param array $results + * @return array + */ + public function processColumnListing($results) { + array_walk($results, function(&$object) { + $array = (array) $object; + $object = trim($array['RDB$FIELD_NAME']); + }); + return $results; + } + } \ No newline at end of file diff --git a/src/Firebird/Schema/Grammars/FirebirdGrammar.php b/src/Firebird/Schema/Grammars/FirebirdGrammar.php index b00fdcd..2842c3e 100644 --- a/src/Firebird/Schema/Grammars/FirebirdGrammar.php +++ b/src/Firebird/Schema/Grammars/FirebirdGrammar.php @@ -31,7 +31,16 @@ public function compileTableExists() return "SELECT RDB\$RELATION_NAME FROM RDB\$RELATIONS WHERE RDB\$RELATION_NAME = ?"; } - /** + /** + * Compile the query to determine the list of columns. + * + * @return string + */ + public function compileColumnListing($table) { + return "SELECT RDB\$FIELD_NAME FROM RDB\$RELATION_FIELDS WHERE RDB\$RELATION_NAME = '$table'"; + } + + /** * Compile a create table command. * * @param \Illuminate\Database\Schema\Blueprint $blueprint