Extraire la structure d’une BD sous SQLite

12 mai 2010 - 201 mots - base de donnees

Afin de poursuivre ma recherche, je me suis dirigé vers SQLite aprés PostgreSQL.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- listing database from server
-- No Server in SQLite

-- listing users
-- No Users management in SQLite

-- listing groups
-- No Users management in SQLite

-- listing bases
-- No Multiples bases management in SQLite

-- listing tables from a base
SELECT name FROM sqlite_master WHERE type='table';

-- listing tables from a base > COLUMNS
PRAGMA table_info('mytable')

-- listing tables from a base > CONSTRAINTS > PRIMARY KEY
PRAGMA table_info('mytable')

-- listing tables from a base > CONSTRAINTS > FOREIGN KEY
PRAGMA foreign_key_list('mytable')

-- listing views from a base
SELECT name FROM sqlite_master WHERE type ='view'

-- listing types from a base
-- NO User Defined Types in SQLite

-- listing indexes from a base
SELECT name FROM sqlite_master WHERE type='index';

-- listing functions from a base
-- NO Functions or Stored Procedures in SQLite

-- listing triggers from a base
SELECT name FROM sqlite_master WHERE type='trigger';

Laisser un commentaire

Merci. Votre message a bien été enregistré.