Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: sqlite show tables

by dsheroh (Monsignor)
on Jul 19, 2021 at 07:36 UTC ( [id://11135160]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11135160]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-28 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found