Skip to content

Commit 917ef45

Browse files
authored
Add docs link
1 parent bcac48e commit 917ef45

File tree

1 file changed

+4
-37
lines changed

1 file changed

+4
-37
lines changed

README.md

+4-37
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ Are you tired of these lots of heavy database libraries which do a lot of things
22

33
> Alert: This project will not fill all the edge database cases and does not aim to do so.
44
5+
## Documentation
6+
You can find the full library documentaion [here](https://github.com/ceifa/sqlier/wiki).
7+
58
## Usage
69

710
### Setup a database
811

9-
Firstly you will need to setup your databases, you can do it in two ways.
10-
#### First method: Initialize function
11-
sqlier can be itnialized by running the initializer function `sqlier.Initialize(name, drive, conn)` which accepts the following arguments:
12+
Firstly you will need to setup your databases, sqlier can be initialized by running the initializer function `sqlier.Initialize(name, drive, conn)` which accepts the following arguments:
1213

1314
1. `STRING` `name`: Identification name for the database (can be anything)
1415
2. `STRING` `driver`: The desired database driver, currently supports:
@@ -24,20 +25,6 @@ sqlier.Initialize("db1", "sqlite")
2425
-- MySQL
2526
sqlier.Initialize("db2", "mysqloo", { address = "localhost", port = "3306", database = "GmodServer", user = "root", password = "" })
2627
```
27-
#### Second method: Json config file
28-
sqlier will also search for the `data/sqlier/database` directory:
29-
30-
* db2.json
31-
```json
32-
{
33-
"driver": "mysqloo",
34-
"address": "localhost",
35-
"port": "3306",
36-
"database": "GmodServer",
37-
"user": "root",
38-
"password": ""
39-
}
40-
```
4128

4229
### Setup a model
4330

@@ -71,19 +58,6 @@ local User = sqlier.Model({
7158

7259
The columns `CreateTimestamp` and `UpdateTimestamp` are hard-coded internally populated automatically.
7360

74-
Available data types are:
75-
76-
```lua
77-
sqlier.Type.String
78-
sqlier.Type.Integer
79-
sqlier.Type.Float
80-
sqlier.Type.SteamId64
81-
sqlier.Type.Bool
82-
sqlier.Type.Date
83-
sqlier.Type.DateTime
84-
sqlier.Type.Timestamp
85-
```
86-
8761
### Instantiate, update or delete a model
8862

8963
```lua
@@ -98,9 +72,6 @@ new_user.Rank = "donator"
9872
new_user:save()
9973

10074
new_user:delete()
101-
102-
-- throw an error
103-
new_user:save()
10475
```
10576

10677
If you want to know when a save or delete is done, you can pass a callback or use their async api, if using `util.Promise`:
@@ -155,7 +126,3 @@ else
155126
error("Database driver not supported")
156127
end
157128
```
158-
159-
### Logs
160-
161-
To enable the querying logs, set the convar `sqlier_logs` to `1`. Error logs will always log at the console and to the `data/sqlier` folder, at the `errors.txt` file.

0 commit comments

Comments
 (0)