Skip to content

Commit 5459c3a

Browse files
committed
Fix typos in README
1 parent ad37b90 commit 5459c3a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ using [libpq] with asynchronousity in mind.
66
Besides binary module you'll probably need to add [`async_postgres.lua`][lua module] to your project.
77

88
## Features
9-
* Fully asynchronous, yet allows to wait a query to finish
9+
* Fully asynchronous, yet allows to wait for a query to finish
1010
* Provides full simplified [libpq] interface
11-
* Simple, robust and efficient
11+
* Simple, robust, and efficient
1212
* Flexible [lua module] which extends functionality
13-
* [Type friendly][LuaLS] [lua module] with documentatio
13+
* [Type friendly][LuaLS] [lua module] with documentation
1414

1515
## Installation
1616
1. Go to [releases](https://github.com/Pika-Software/gmsv_async_postgres/releases)
1717
2. Download `async_postgres.lua` and `gmsv_async_postgres_xxx.dll` files
1818
> [!NOTE]
19-
> If are unsure which binary to download, you can run this command inside console of your server
19+
> If you are unsure which binary to download, you can run this command inside the console of your server
2020
> ```lua
2121
> lua_run print("gmsv_async_postgres_" .. (system.IsWindows() and "win" or system.IsOSX() and "osx" or "linux") .. (jit.arch == "x64" and "64" or not system.IsLinux() and "32" or "") .. ".dll")
2222
> ```
23-
3. Put `gmsv_async_postgres_xxx.dll` inside `garrysmod/lua/bin/` folder (if folder does not exists, create it)
23+
3. Put `gmsv_async_postgres_xxx.dll` inside the `garrysmod/lua/bin/` folder (if the folder does not exist, create it)
2424
4. Put `async_postgres.lua` inside `garrysmod/lua/autorun/server/` or inside your project folder
2525
5. Profit 🎉
2626
2727
## Caveats
28-
* when `queryParams` is used and parameters is `string`, then string will be sent as bytes!<br>
29-
You'll need to convert numbers **exclipitly** to `number` type, otherwise
30-
PostgreSQL will interpent parameter as binary integer, and will return error
31-
or unexpected results may happend.
28+
* When `queryParams` is used and the parameter is `string`, then the string will be sent as bytes!<br>
29+
You'll need to convert numbers **explicitly** to the `number` type, otherwise
30+
PostgreSQL will interpret the parameter as a binary integer, and will return an error
31+
or unexpected results may happen.
3232
3333
* Result rows are returned as strings, you'll need to convert them to numbers if needed.
34-
* You'll need to use `Client:unescapeBytea(...)` to convert bytea data to string from reuslt.
34+
* You'll need to use `Client:unescapeBytea(...)` to convert bytea data to string from the result.
3535
3636
## Usage
3737
`async_postgres.Client` usage example
@@ -49,11 +49,11 @@ client:connect(function(ok, err)
4949
end)
5050
5151
-- PostgreSQL can only process one query at a time,
52-
-- but async_postgres.Client has internal queue for queries
52+
-- but async_postgres.Client has an internal queue for queries
5353
-- so you can queue up as many queries as you want
5454
-- and they will be executed one by one when possible
5555
--
56-
-- For example this query will be executed after the connection is established
56+
-- For example, this query will be executed after the connection is established
5757
client:query("select now()", function(ok, res)
5858
assert(ok, res)
5959
print("Current time is " .. res.rows[1].now)
@@ -88,7 +88,7 @@ client:close() -- passing true will wait for all queries to finish, but we did w
8888
```lua
8989
local pool = async_postgres.Pool("postgresql://postgres:postgres@localhost")
9090

91-
-- You can make same queries as with Client
91+
-- You can make the same queries as with Client
9292
-- but with Pool you don't need to worry about connection
9393
-- Pool will manage connections for you
9494
pool:query("select now()", function(ok, res)
@@ -110,13 +110,13 @@ pool:transaction(function(ctx)
110110
print("Value in transaction is: " .. res.rows[1].value) -- will output "Value in transaction is barfoo"
111111

112112
-- If error happens in transaction, it will be rolled back
113-
error("welp something went wrong :p)
113+
error("welp something went wrong :p")
114114

115-
-- if no error happens, transaction will be commited
115+
-- if no error happens, transaction will be committed
116116
end)
117117

118-
-- Or you can use :connect() to create your own transactions or for smth else
119-
-- :connect() will acquire first available connected Client from the Pool
118+
-- Or you can use :connect() to create your own transactions or for something else
119+
-- :connect() will acquire the first available connected Client from the Pool
120120
-- and you'll need to call client:release() when you're done
121121
pool:connect(function(client)
122122
client:query("select now()", function(ok, res)
@@ -174,7 +174,7 @@ end)
174174
- `Client:parameterStatus(paramName)`: Looks up a current parameter setting
175175
- `Client:protocolVersion()`: Interrogates the frontend/backend protocol being used
176176
- `Client:serverVersion()`: Returns the server version as integer
177-
- `Client:errorMessage()`: Returns last error message
177+
- `Client:errorMessage()`: Returns the last error message
178178
- `Client:backendPID()`: Returns the backend process ID
179179
- `Client:sslInUse()`: Returns true if SSL is used
180180
- `Client:sslAttribute(name)`: Returns SSL-related information

0 commit comments

Comments
 (0)