Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 29489e0

Browse files
authored
Update README.md
1 parent 7ad314f commit 29489e0

File tree

1 file changed

+74
-4
lines changed

1 file changed

+74
-4
lines changed

README.md

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# tables
2-
31
This is a python script that lets users quickly view their database table schema. I wrote this as a simple way to quickly view my database table columns.
42

53
## Installation
@@ -10,12 +8,84 @@ pip install git+https://github.com/rrickgauer/tables.git
108

119
## Usage
1210

13-
To run:
11+
To see a list of all your connections:
12+
13+
```sh
14+
tables list
15+
```
16+
17+
To add a new connection:
18+
19+
```sh
20+
tables add
21+
```
22+
23+
To delete a connection:
1424

1525
```sh
16-
tables [list, view, delete, add]
26+
tables delete
1727
```
1828

29+
To view the tables of a connection:
30+
31+
```sh
32+
tables view
33+
```
34+
35+
36+
### View Command
37+
38+
There are several different options for viewing a database schema.
39+
40+
#### Tables/Views
41+
42+
List all tables and views:
43+
44+
```sh
45+
tables view -n connection_name
46+
```
47+
48+
Dump schemas of both tables and views:
49+
50+
```sh
51+
tables view -n connection_name [-a,--all]
52+
```
53+
54+
Dump schemas of tables:
55+
56+
```sh
57+
tables view -n connection_name [-t,--tables]
58+
```
59+
60+
Dump schemas of views:
61+
62+
```sh
63+
tables view -n connection_name [-v,--views]
64+
```
65+
66+
#### Save output to file
67+
68+
To write the output to a file, you can use the `-o,--output` flag:
69+
70+
```sh
71+
tables view -n connection_name --output /desktop/tables-output.txt
72+
```
73+
74+
#### Format
75+
76+
You can specify the format of the output by using the `-f,--format` option:
77+
78+
```sh
79+
tables view -n connection_name {-f,--format} format_value
80+
```
81+
82+
Currently, there are 4 options you can choose from:
83+
84+
1. table (default)
85+
1. markdown
86+
1. html
87+
1. json
88+
1989

2090
## Additional notes
2191

0 commit comments

Comments
 (0)