Skip to content

Commit e9611a5

Browse files
authored
Merge pull request #86 from uepg/revert-84-revert-83-laravel-sybase
Revert "Revert "Rewittren the library""
2 parents 13aa740 + 4dcb26e commit e9611a5

File tree

7 files changed

+403
-628
lines changed

7 files changed

+403
-628
lines changed

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ return [
6363
...
6464

6565
'sybase' => [
66-
'driver' => 'sqlsrv',
66+
'driver' => 'sybasease',
6767
'host' => env('DB_HOST', 'sybase.myserver.com'),
6868
'port' => env('DB_PORT', '5000'),
6969
'database' => env('DB_DATABASE', 'mydatabase'),
7070
'username' => env('DB_USERNAME', 'user'),
7171
'password' => env('DB_PASSWORD', 'password'),
72-
'charset' => 'utf8',
72+
'charset' => 'utf8', // Experimental yet, prefer use the `DB_CHARSET` and `APPLICATION_CHARSET`
7373
'prefix' => '',
7474
],
7575

@@ -107,6 +107,22 @@ The file is usualy found in **/etc/freetds/freetds.conf**. Set the configuration
107107
tds version = 5.0
108108
```
109109

110+
## Configuring the charset between the database and the application
111+
To configure the charset between the database and the application, add the fields `DB_CHARSET` and `APPLICATION_CHARSET` in `.env` file, see the following example:
112+
113+
```env
114+
DB_CHARSET=CP850
115+
APPLICATION_CHARSET=UTF8
116+
```
117+
## Configuring the cache
118+
As the library consults table information whenever it receives a request, caching can be used to avoid excessive queries
119+
120+
To use the cache, add the fields `SYBASE_CACHE_COLUMNS` and `SYBASE_CACHE_COLUMNS_TIME` to the `.env` file, see the following example:
121+
```dotenv
122+
SYBASE_CACHE_COLUMNS=true
123+
SYBASE_CACHE_COLUMNS_TIME=3600 # cache table information by `3600` seconds
124+
```
125+
110126
## Setting to use numeric data type
111127

112128
In the migration file you must replace `use Illuminate\Database\Schema\Blueprint;` with `use Uepg\LaravelSybase\Database\Schema\Blueprint;`. See the following example:

composer.json

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
{
1414
"name": "Ademir Mazer Junior",
1515
"email": "[email protected]"
16+
},
17+
{
18+
"name": "Matheus Bueno Bartkevicius",
19+
"email": "[email protected]"
1620
}
1721
],
1822
"support": {

0 commit comments

Comments
 (0)