Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude sqlite_% from listTables() #2228

Merged
merged 2 commits into from
Sep 17, 2019

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented Sep 17, 2019

Description
SQLite will ad-hoc add various tables prefixed "sqlite_" that function similar to MySQL's information_schema. See for example these metadata test results (https://travis-ci.org/codeigniter4/CodeIgniter4/jobs/586068130):

1) CodeIgniter\Database\Live\MetadataTest::testListTables
585Failed asserting that two arrays are equal.
586--- Expected
587+++ Actual
588@@ @@
589 Array (
590     0 => 'db_migrations'
591-    1 => 'db_user'
592-    2 => 'db_job'
593-    3 => 'db_misc'
594-    4 => 'db_empty'
595-    5 => 'db_secondary'
596+    1 => 'sqlite_sequence'
597+    2 => 'db_user'
598+    3 => 'db_job'
599+    4 => 'db_misc'
600+    5 => 'db_empty'
601+    6 => 'db_secondary'
602 )

... where sqlite_sequence is being returned as a table. I think these tables should be excluded as system data to be consistent with the other database drivers. E.g. if I use forge to add two tables to an empty database, listTables() should return two tables regardless of driver.

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@lonnieezell lonnieezell merged commit 39f4c1b into codeigniter4:develop Sep 17, 2019
@MGatner MGatner mentioned this pull request Sep 17, 2019
5 tasks
@MGatner MGatner deleted the sqlite-listtables branch September 17, 2019 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants