From 4931422baf2e06ae915024c22fbbbab0916e1d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Neder=20Alfonso=20Fandi=C3=B1o=20Andrade?= Date: Fri, 18 Aug 2017 15:59:21 -0500 Subject: [PATCH 1/3] Ignore files generated IDE --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) 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/ From 0e6de8f253528db1bfe268142def974fc1ad13fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Neder=20Alfonso=20Fandi=C3=B1o=20Andrade?= Date: Fri, 18 Aug 2017 18:31:27 -0500 Subject: [PATCH 2/3] Added method compileColumnListing --- src/Firebird/Schema/Grammars/FirebirdGrammar.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 From 99553bf90c397d3bd72d0d31b2d6e7650484770e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Neder=20Alfonso=20Fandi=C3=B1o=20Andrade?= Date: Fri, 18 Aug 2017 18:50:03 -0500 Subject: [PATCH 3/3] Added method processColumnListing --- .../Query/Processors/FirebirdProcessor.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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