Skip to content

Commit 2bb7945

Browse files
authoredDec 9, 2024··
Merge pull request #16 from LouGel/typos
Typos
1 parent 4b4430e commit 2bb7945

File tree

1 file changed

+39
-37
lines changed

1 file changed

+39
-37
lines changed
 

‎README.md

+39-37
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ with functionality like [Knex][knex-url] (from the Node.js world). Squirrel itse
1313
doesn't provide other types of queries for creating a table, upsert,
1414
and some other things. Bob is meant to fill those gaps.
1515

16-
The different between Bob and Squirrel is that Bob is solely a query builder.
17-
The users have to execute and manage the SQL connection themself.
18-
Meaning there are no ExecWith() function implemented on Bob, as you can
16+
The difference between Bob and Squirrel is that Bob is solely a query builder.
17+
The users have to execute and manage the SQL connection themselves.
18+
Meaning there is no ExecWith() function implemented in Bob, as you can
1919
find it on Squirrel.
2020

2121
The purpose of an SQL query builder is to prevent any typo or mistypes
@@ -41,7 +41,7 @@ you are good to go.
4141

4242
Either way, I'm not 100% confident enough to say that this thing is
4343
production ready. But, the way I see it, it's good enough to be used
44-
on a production-level applications. In fact, I'm using it on one of my
44+
on a production-level application. In fact, I'm using it on one of my
4545
current projects that's getting around 100-200 hits per day.
4646

4747
If you have any feature request or improvement ideas for the project,
@@ -57,7 +57,7 @@ func main() {
5757
sql, _, err := bob.
5858
CreateTable("tableName").
5959
// The first parameter is the column's name.
60-
// The second parameters and so on forth are extras.
60+
// The second parameter and so on forth are extras.
6161
StringColumn("id", "NOT NULL", "PRIMARY KEY", "AUTOINCREMENT").
6262
StringColumn("email", "NOT NULL", "UNIQUE").
6363
// See the list of available column definition types through pkg.go.dev or scroll down below.
@@ -72,21 +72,22 @@ func main() {
7272
```
7373

7474
Available column definition types (please be aware that some only works on certain database):
75-
* `StringColumn()` - Default to `VARCHAR(255)`
76-
* `TextColumn()` - Default to `TEXT`
77-
* `UUIDColumn()` - Defaults to `UUID`
78-
* `BooleanColumn()` - Defaults to `BOOLEAN`
79-
* `IntegerColumn()` - Defaults to `INTEGER`. Postgres and SQLite only.
80-
* `IntColumn()` - Defaults to `INT`. MySQL and MSSQL only.
81-
* `RealColumn()` - Defaults to `REAL`. Postgres, MSSQL, and SQLite only.
82-
* `FloatColumn()` - Defaults to `FLOAT`. Postgres and SQLite only.
83-
* `DateTimeColumn()` - Defaults to `DATETIME`.
84-
* `TimeStampColumn()` - Defaults to `TIMESTAMP`.
85-
* `TimeColumn()` - Defaults to `TIME`.
86-
* `DateColumn()` - Defaults to `DATE`.
87-
* `JSONColumn()` - Dafults to `JSON`. MySQL and Postgres only.
88-
* `JSONBColumn()` - Defaults to `JSONB`. Postgres only.
89-
* `BlobColumn()` - Defaults to `BLOB`. MySQL and SQLite only.
75+
76+
- `StringColumn()` - Default to `VARCHAR(255)`
77+
- `TextColumn()` - Default to `TEXT`
78+
- `UUIDColumn()` - Defaults to `UUID`
79+
- `BooleanColumn()` - Defaults to `BOOLEAN`
80+
- `IntegerColumn()` - Defaults to `INTEGER`. Postgres and SQLite only.
81+
- `IntColumn()` - Defaults to `INT`. MySQL and MSSQL only.
82+
- `RealColumn()` - Defaults to `REAL`. Postgres, MSSQL, and SQLite only.
83+
- `FloatColumn()` - Defaults to `FLOAT`. Postgres and SQLite only.
84+
- `DateTimeColumn()` - Defaults to `DATETIME`.
85+
- `TimeStampColumn()` - Defaults to `TIMESTAMP`.
86+
- `TimeColumn()` - Defaults to `TIME`.
87+
- `DateColumn()` - Defaults to `DATE`.
88+
- `JSONColumn()` - Defaults to `JSON`. MySQL and Postgres only.
89+
- `JSONBColumn()` - Defaults to `JSONB`. Postgres only.
90+
- `BlobColumn()` - Defaults to `BLOB`. MySQL and SQLite only.
9091

9192
For any other types, please use `AddColumn()`.
9293

@@ -244,10 +245,11 @@ func main() {
244245
```
245246

246247
Available placeholder formats:
247-
* `bob.Question` - `INSERT INTO "users" (name) VALUES (?)`
248-
* `bob.Dollar` - `INSERT INTO "users" (name) VALUES ($1)`
249-
* `bob.Colon` - `INSERT INTO "users" (name) VALUES (:1)`
250-
* `bob.AtP` - `INSERT INTO "users" (name) VALUES (@p1)`
248+
249+
- `bob.Question` - `INSERT INTO "users" (name) VALUES (?)`
250+
- `bob.Dollar` - `INSERT INTO "users" (name) VALUES ($1)`
251+
- `bob.Colon` - `INSERT INTO "users" (name) VALUES (:1)`
252+
- `bob.AtP` - `INSERT INTO "users" (name) VALUES (@p1)`
251253

252254
### With pgx (PostgreSQL)
253255

@@ -264,7 +266,7 @@ import (
264266
func main() {
265267
db := pgx.Connect()
266268

267-
// Check if a table is exists
269+
// Check if a table exists
268270
sql, args, err = bob.HasTable("users").PlaceholderFormat(bob.Dollar).ToSql()
269271
if err != nil {
270272
log.Fatal(err)
@@ -320,17 +322,17 @@ func main() {
320322

321323
## Features
322324

323-
* `bob.CreateTable(tableName)` - Basic SQL create table
324-
* `bob.CreateTableIfNotExists(tableName)` - Create table if not exists
325-
* `bob.CreateIndex(indexName)` - Basic SQL create index
326-
* `bob.CreateIndexIfNotExists(tableName)` - Create index if not exists
327-
* `bob.HasTable(tableName)` - Checks if column exists (return error if false, check example above for error handling)
328-
* `bob.HasColumn(columnName)` - Check if a column exists on current table
329-
* `bob.DropTable(tableName)` - Drop a table (`drop table "users"`)
330-
* `bob.DropTableIfExists(tableName)` - Drop a table if exists (`drop table if exists "users"`)
331-
* `bob.RenameTable(currentTable, desiredName)` - Rename a table (`rename table "users" to "people"`)
332-
* `bob.Truncate(tableName)` - Truncate a table (`truncate "users"`)
333-
* `bob.Upsert(tableName, dialect)` - UPSERT function (`insert into "users" ("name", "email") values (?, ?) on duplicate key update email = ?`)
325+
- `bob.CreateTable(tableName)` - Basic SQL create table
326+
- `bob.CreateTableIfNotExists(tableName)` - Create table if not exists
327+
- `bob.CreateIndex(indexName)` - Basic SQL create index
328+
- `bob.CreateIndexIfNotExists(tableName)` - Create index if not exists
329+
- `bob.HasTable(tableName)` - Checks if column exists (return error if false, check example above for error handling)
330+
- `bob.HasColumn(columnName)` - Check if a column exists on current table
331+
- `bob.DropTable(tableName)` - Drop a table (`drop table "users"`)
332+
- `bob.DropTableIfExists(tableName)` - Drop a table if exists (`drop table if exists "users"`)
333+
- `bob.RenameTable(currentTable, desiredName)` - Rename a table (`rename table "users" to "people"`)
334+
- `bob.Truncate(tableName)` - Truncate a table (`truncate "users"`)
335+
- `bob.Upsert(tableName, dialect)` - UPSERT function (`insert into "users" ("name", "email") values (?, ?) on duplicate key update email = ?`)
334336

335337
## Contributing
336338

@@ -353,6 +355,6 @@ Bob is licensed under [MIT license](./LICENSE)
353355
[codecov-badge]: https://codecov.io/gh/aldy505/bob/branch/master/graph/badge.svg?token=Noeexg5xEJ
354356
[codecov-link]: https://codecov.io/gh/aldy505/bob
355357
[codacy-badge]: https://app.codacy.com/project/badge/Grade/9b78970127c74c1a923533e05f65848d
356-
[codacy-link]: https://www.codacy.com/gh/aldy505/bob/dashboard?utm_source=github.com&utm_medium=referral&utm_content=aldy505/bob&utm_campaign=Badge_Grade
358+
[codacy-link]: https://www.codacy.com/gh/aldy505/bob/dashboard?utm_source=github.com&utm_medium=referral&utm_content=aldy505/bob&utm_campaign=Badge_Grade
357359
[actions-badge]: https://github.com/aldy505/bob/actions/workflows/coverage.yml/badge.svg
358360
[actions-link]: https://github.com/aldy505/bob/actions/workflows/coverage.yml

0 commit comments

Comments
 (0)
Please sign in to comment.