laravel-odbc
laravel-odbc copied to clipboard
PSR-4 autoloader instead of class map
In the composer.json file is call map used for autoloading:
"autoload": {
"classmap": [
"src"
]
},
I would recommend to use PSR-4 for follwing reasons:
- Lavarel standard is PSR-4
- Classes in subfolders like
src/grammars
are loaded automatically with namespaceAbram\ODBC\Grammars
- This opens the possibility to add grammars for different databases eg. SAP SQL Anywhere via Pull request
"autoload": {
"psr-4": {
"Abram\\ODBC\\": "src/"
}
},
With current solution I have to put the grammar classes in 'App' Folder somewhere in order that autoloader can find the grammar classes.
Hi, can you PR this feature?
Hi @Enrica-r
I am also working with SAP HANA SQL. I used this ODBC to connect with HANA SQL. It is working fine. But migrations are not working. If you know any solution please, help me.
Hi @prasanthjayakumar The default grammars doesn't work for all databases. I used SQLAnywhere database 2 years ago. So I found in another repo a query grammar and a schema grammar class. I modified this and copied it in a folder "grammar" within database/grammar. Check that this folder is loaded in composor.json (psr-4). Then define the two files in your database options of your odbc driver. The array has a property options.grammar.query or ...schema. If there doesn't exist grammar classes for Hana SQL so you have to write it by yourself.