jcrodriguezt / laravel-sybase
Sybase based Eloquent module extension for Laravel > 7.x.
Installs: 1 133
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 18
Open Issues: 5
Requires
- php: >=8.1
- doctrine/dbal: ^3.5
- illuminate/database: 8.*|9.*|10.*|11.*
- illuminate/support: ~8.0|~9.0|~10.0|~11.0
- dev-master
- v3.2.2
- v3.2.1
- v3.2
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.0
- v2.6.8
- v2.6.7
- 2.6.6
- 2.6.5
- 2.6.5a
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.5
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0
- 1.3.2
- 1.3.1
- 1.3
- 1.2.1
- 1.2.0.7
- 1.2.0.6
- 1.2.0.5
- 1.2.0.4
- 1.2.0.3
- 1.2.0.2
- 1.2.0.1
- 1.2
- 1.1
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0
- 0.3.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2
- 0.1.1
- 0.1.0
- dev-analysis-Ko5Z73
- dev-analysis-APJvkG
This package is auto-updated.
Last update: 2024-11-14 07:19:10 UTC
README
- Original codebase https://github.com/uepg/laravel-sybase.
- Use default eloquent syntax
- Improvements in delete and insert statements when using array based clauses like whereIn, whereBetween, etc
- Works with MS-SQL connections too via FreeTds
- Support for Laravel versions 7.x, 8.x, 9.x, 10.x, 11.x
Install
composer require jcrodriguezt/laravel-sybase
Update
Update the following in the require section of your composer.json:
"jcrodriguezt/laravel-sybase": "~3.2"
Update the package dependencies executing:
#> composer update
Install
Update your config/database.php's default driver with the settings for your sybase server or your custom odbc. See the following example: (please note the sybasease driver name)
<?php
...
return [
...
'connections' => [
...
'sybase' => [
'driver' => 'sybasease',
'host' => env('DB_HOST', 'sybase.myserver.com'),
'port' => env('DB_PORT', '5000'),
//'dsn' => env('DB_DSN'), // remove comment in case you define an odbc connection in your env
'database' => env('DB_DATABASE', 'mydatabase'),
'username' => env('DB_USERNAME', 'user'),
'password' => env('DB_PASSWORD', 'password'),
'prefix' => '',
],
...
],
...
]
To use different charset set on your .env
DB_CHARSET=DBCHARSET APPLICATION_CHARSET=APPLICATIONCHARSET
for example:
DB_CHARSET=CP850 APPLICATION_CHARSET=UTF-8
Update your .env with the settings for the sybase connection. See the following example:
...
DB_CONNECTION=sybase
DB_HOST=sybase.mycompany.com
DB_PORT=5000
#remove comment on next line to use odbc
#DB_DSN="odbc:\\\\sybase_odbc_name"
DB_DATABASE=mydatabase
DB_USERNAME=user
DB_PASSWORD=password
...
Configuration of freetds driver
In Linux systems the driver version must be set in freetds.conf file to the right use of charset pages.
The file is usualy found in /etc/freetds/freetds.conf. Set the configuration at global section as the following example:
[sybase]
host = sybase.mycompany.com
# port is important
port = 6000
# TDS protocol version
tds version = 5.0
[sqlserver]
host = mssql.mycompany.com
# When connecting to an instance you specify it, and there's no need for the port directive
instance = sqlexpress
tds version = 7.3
[sqlserverexpress]
host = myssqlexpress.mycompany.com
port = 1433
tds version = 7.3
Issues
Feel free to ask in https://github.com/jcrodriguezt/laravel-sybase/issues