in reply to sqlite show tables

Meta/structural things like listing all the tables are specific to each database engine, rather than a part of the common SQL standard. The closest sqlite equivalent I'm aware of is the .schema command, which will show you all of the table and index definitions in the database. You can also use .schema tablename to show only a single table definition.

But, yes, in the DBI context, it's probably better to use the generic methods provided by DBI, as already suggested by Corion.

Replies are listed 'Best First'.
Re^2: sqlite show tables
by igoryonya (Pilgrim) on Jul 20, 2021 at 04:19 UTC
    Is it possible to execute .schema from the DBI or is it a cli client only thing?
      I don't actually know. I've never tried using .schema (or show tables with mysql) in DBI code, only in the interactive clients. When I've wanted to get a database's list of tables from DBI code, I've done it with my @tables = $dbh->tables(undef, undef, undef, 'TABLE'); (Documentation)
        Hm, looks like, they've marked it (->tables) as deprecated.