Skip to content

Commit 5e98a3d

Browse files
committed
README.md: add options and update the example and the list of features
1 parent 976c71b commit 5e98a3d

File tree

1 file changed

+50
-34
lines changed

1 file changed

+50
-34
lines changed

README.md

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ SQL-Bless
33

44
The SQL-Bless is a command-line database client like SQL\*Plus or psql.
55

6-
- Emacs-like keybindings for inline editing of multiple lines of SQL
6+
- Emacs-like keybindings for inline editing of multiple lines of SQL.
7+
- The action of `Enter` key will only insert a line feed code.
8+
- Press `Ctrl`-`Enter` to execute the input.
79
- Save the result of SELECT in CSV format
10+
- Oracle and PostgreSQL are supported.
11+
- Any database supported by Go's "database/sql" can be used with a
12+
small amount of extra code in `dbdepends.go`
813

914
![image](./demo.gif)
1015

@@ -15,8 +20,8 @@ The SQL-Bless is a command-line database client like SQL\*Plus or psql.
1520
| `Ctrl`-`F`/`B`/`N`/`P` | Editing like Emacs |
1621
| `Ctrl`-`C` | Exit with rollback |
1722
| `Ctrl`-`D` | Delete character or submit EOF (exit with rollback) |
18-
| `ALT`-`P`, `Ctrl`-`Up` | Insert the previous SQL (history)|
19-
| `ALT`-`N`, `Ctrl`-`Down` | Insert the next SQL (history) |
23+
| `ALT`-`P`, `Ctrl`-`Up`, `PageUp` | Insert the previous SQL (history)|
24+
| `ALT`-`N`, `Ctrl`-`Down`, `PageDown` | Insert the next SQL (history) |
2025

2126
Supported commands
2227
------------------
@@ -35,41 +40,25 @@ Semicolon `;` can be omitted.
3540
Example of a spooled file
3641
--------------------------
3742

38-
```csv
39-
# (2023-04-16 08:54:28)
40-
# select * from tab where rownum < 3
43+
``` CSV
44+
# (2023-04-17 22:52:16)
45+
# select *
46+
# from tab
47+
# where rownum < 5
4148
TNAME,TABTYPE,CLUSTERID
42-
AQ$_INTERNET_AGENTS,TABLE,<nil>
43-
AQ$_INTERNET_AGENT_PRIVS,TABLE,<nil>
44-
# (2023-04-16 08:54:33)
49+
AQ$_INTERNET_AGENTS,TABLE,<NULL>
50+
AQ$_INTERNET_AGENT_PRIVS,TABLE,<NULL>
51+
AQ$_KEY_SHARD_MAP,TABLE,<NULL>
52+
AQ$_QUEUES,TABLE,<NULL>
53+
# (2023-04-17 22:52:20)
4554
# history
46-
0,2023-04-16 08:54:14,spool hoge
47-
1,2023-04-16 08:54:28,select * from tab where rownum < 3
48-
2,2023-04-16 08:54:33,history
49-
# (2023-04-16 09:01:29)
50-
# select * from tab where rownum < 3
51-
TNAME,TABTYPE,CLUSTERID
52-
AQ$_INTERNET_AGENTS,TABLE,<nil>
53-
AQ$_INTERNET_AGENT_PRIVS,TABLE,<nil>
55+
0,2023-04-17 22:52:05,spool hoge
56+
1,2023-04-17 22:52:16,"select *
57+
from tab
58+
where rownum < 5"
59+
2,2023-04-17 22:52:20,history
5460
```
5561

56-
Supporting DB
57-
-------------
58-
59-
### Oracle
60-
61-
$ sqlbless oracle oracle://USERNAME:PASSWORD@HOSTNAME:PORT/SERVICE
62-
63-
- On error, your transaction is not rolled back.
64-
65-
### PostgreSQL
66-
67-
$ sqlbless postgres "host=127.0.0.1 port=5555 user=USERNAME password=PASSWORD dbname=DBNAME sslmode=disable"
68-
69-
- Autocommit is disabled. With INSERT, UPDATE, or DELETE, a transaction starts.
70-
- On error, the transaction is rolled back automatically because it aborted.
71-
72-
7362
Install
7463
-------
7564

@@ -87,3 +76,30 @@ or
8776
scoop bucket add hymkor https://github.com/hymkor/scoop-bucket
8877
scoop install sqlbless
8978
```
79+
80+
How to start
81+
-------------
82+
83+
### Oracle
84+
85+
$ sqlbless oracle oracle://USERNAME:PASSWORD@HOSTNAME:PORT/SERVICE
86+
87+
- On error, your transaction is not rolled back.
88+
89+
### PostgreSQL
90+
91+
$ sqlbless postgres "host=127.0.0.1 port=5555 user=USERNAME password=PASSWORD dbname=DBNAME sslmode=disable"
92+
93+
- Autocommit is disabled. With INSERT, UPDATE, or DELETE, a transaction starts.
94+
- On error, the transaction is rolled back automatically because it aborted.
95+
96+
### Common Options
97+
98+
- `-crlf`
99+
- Use CRLF
100+
- `-fs string`
101+
- Set a field separator (default `","`)
102+
- `-null string`
103+
- Set a string representing NULL (default `"<NULL>"`)
104+
- `-tsv`
105+
- Use TAB as seperator

0 commit comments

Comments
 (0)