jeandormehl / laracache Goto Github PK
View Code? Open in Web Editor NEWLaravel package providing InterSystems Cache as a data source using ODBC
License: MIT License
Laravel package providing InterSystems Cache as a data source using ODBC
License: MIT License
@jeandormehl Do you see sometimes that problem? A few per month and it is momentaneous.
SQLSTATE[HY000] SQLDriverConnect: 12104 [Cache ODBC][State : HY000][Native Code 12104]
[libcacheodbcur6435.so]
Socket: Connection reset by peer (due to timeout or reboot)
Maybe an infraestructure problem in Caché DB / Network ? Or something we can do better on handling ODBC connections?
Could you share your full odbc.ini
file?
return [
'isc' => [
....
'options' => [
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_OBJ,
\PDO::ATTR_CASE => \PDO::CASE_LOWER, // <---------------------- not parsed
'processor' => \Laracache\Cache\Query\Processors\Processor::class,
'grammar' => [
'query' => \Laracache\Cache\Query\Grammars\Grammar::class,
'schema' => \Laracache\Cache\Schema\Grammars\Grammar::class,
],
],
],
Not sure, but probably $this->getAttribute
should be $this->connection->getAttribute
.
laracache/src/Pdo/Cache/Statement.php
Lines 85 to 93 in 7214330
Although it is a valid test, the resulting query does not make sense.
laracache/tests/CacheQueryBuilderTest.php
Lines 505 to 510 in 7214330
Just executed in Caché (2016) and it does not return the right result, because "top 10" (limit 10) is fixed and it will always get same first top 10 results. So, pagination never happens. Any tricks?
Hi, guys!
It seems FTP for downloading Caché ODBC drivers is not working anymore.
ftp://ftp.intersys.com/pub/cache/odbc/2018/ODBC-2018.1.0.184.0-lnxubuntux64.tar.gz
Could you please share ODBC drivers?
Nice package!
Can you, please, expand the "ODBC Drivers for caché" section from README? How to install and setup the caché odbc driver? The official docs from Intersystem is very tricky about how to install!
https://github.com/jeandormehl/laracache#odbc-drivers-for-cach%C3%A9
I am getting SQLSTATE[IM002] SQLConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified
, probably because "libcacheodbcur6435" is not properly installed
Here is my .ENV
DB_CONNECTION=isc
DB_HOST=10.0.1.2
DB_PORT=1972
DB_DATABASE=MYNAMESPACE
DB_USERNAME=user1
DB_PASSWORD=pass1
Just noticed $dsn
value is onlyodbc:cache
. Is it supposed to be a full DSN string?
class Cache extends PDO
{
public function __construct($dsn, $username, $password, array $options = [])
{
// must call pdo constructor
parent::__construct($dsn, $username, $password, $options);
Am i missing something? Can you, please, provide a real configuration sample?
Is there any alternative through configuration to ignore special chars like:
á -> a
õ -> o
ç -> c
...
By default Caché does not ignore when making a simple "where" with sql. Otherwise i must implement a translator helper at app level.
Do you gut have any issues with INSERT/UPDATE/DELETE? Could you please share your current config?
For this whole time I have been using LARACACHE for SELECT only.
Now I am trying to make a simple INSERT.
public function test(){
// Laravel begin transaction here
MyModel::create([
'name' => 'Joe'
]);
// Laravel commit transaction here
}
The first time the insert works. But if I try todo a second insert with a different payload I'm getting.
[Cache ODBC][State : S1000][Native Code 110] - [libcacheodbcur64.so] -
[SQLCODE: <-110>:<Locking conflict in filing>]
[Location: <ServerLoop>] [%msg: <Unable to acquire lock for INSERT of table .....
Here is my odbc.ini
[ODBC Data Sources]
cache=cache
[cache]
Driver = /usr/local/cache/2018/bin/libcacheodbcur64.so
Description = InterSystems Cache ODBC Connection
Protocol = TCP
Query Timeout = 1
Static Cursors = 0
Authentication Method = 0
Here is isc.config
'driver' => 'odbc',
'win_dsn' => env('DB_WIN_DSN', ''), // windows users only
'unix_driver' => env('DB_UNIX_DRIVER', ''), // unix users only
'host' => env('DB_HOST', ''),
'port' => env('DB_PORT', 1972),
'database' => env('DB_DATABASE', ''), // namespace
'username' => env('DB_USERNAME', '_SYSTEM'),
'password' => env('DB_PASSWORD', 'SYS'),
'schema' => env('DB_SCHEMA', 'SQLUser'), // SQLUser is default, avoid changing if possible
'options' => [
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_OBJ,
\PDO::ATTR_CASE => \PDO::CASE_LOWER,
'processor' => \Laracache\Cache\Query\Processors\Processor::class,
'grammar' => [
'query' => \Laracache\Cache\Query\Grammars\Grammar::class,
'schema' => \Laracache\Cache\Schema\Grammars\Grammar::class,
],
],
Support for Laravel 10 would be appreciated :)
Hi, @jeandormehl
When you have a chance could you please authorize this repository on https://about.codecov.io/ ? Use "login with github"
It is necessary to generate code coverage badges and coverage reports.
Thank you!
I am experiencing a issue when retrieving fields within max column size defined on a table.
After "composer install" it tries to connect.
Considering we have CI pipelines, it is usual to have a "test" step where no connection is needed. It causes a failure because package always tries to connect to database.
The same does not occurs when using Mysql or Postgres.
Am i missing some config?
I am considering using laracache
on production. Can you tag first the version?
Currently it is on dev-master
Hi,
I am facing a issue where the first run/query/connection it a bit slow, but subsequents one get faster.
Is there any configuration am i missing? Just used default odbc.ini
on README.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.