Giter VIP home page Giter VIP logo

laravel-firebird's Introduction

Firebird for Laravel

Latest Stable Version Total Downloads Tests License

This package adds support for the Firebird PDO Database Driver in Laravel applications.

Version Support

  • PHP: 7.4, 8.0, 8.1, 8.2
  • Laravel: 8.x, 9.x, 10.x
  • Firebird: 2.5, 3.0, 4.0

Installation

You can install the package via composer:

composer require harrygulliford/laravel-firebird

The package will automatically register itself.

Declare the connection within your config/database.php file by using firebird as the driver:

'connections' => [

    'firebird' => [
        'driver'   => 'firebird',
        'host'     => env('DB_HOST', 'localhost'),
        'port'     => env('DB_PORT', '3050'),
        'database' => env('DB_DATABASE', '/path_to/database.fdb'),
        'username' => env('DB_USERNAME', 'sysdba'),
        'password' => env('DB_PASSWORD', 'masterkey'),
        'charset'  => env('DB_CHARSET', 'UTF8'),
        'role'     => null,
    ],

],

To register this package in Lumen, you'll also need to add the following line to the service providers in your config/app.php file: $app->register(\HarryGulliford\Firebird\FirebirdServiceProvider::class);

Limitations

This package does not intend to support database migrations and it should not be used for this use case.

Credits

License

Licensed under the MIT license.

laravel-firebird's People

Contributors

donnykurnia avatar fesoft avatar harrygulliford avatar huesimon avatar jacquestvanzuydam avatar maitrepylos avatar mariuz avatar ricardoseriani avatar selmo47 avatar victorvilella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-firebird's Issues

Unable to load dynamic library 'pdo_firebird'

I'm trying to connect to a remote firebird 1.5 database on Ubuntu Linux and macos, but when opening php artisan tinker, I'm getting this error message on macos:

Warning: PHP Startup: Unable to load dynamic library 'pdo_firebird' (tried: /usr/local/lib/php/pecl/20200930/pdo_firebird (dlopen(/usr/local/lib/php/pecl/20200930/pdo_firebird, 9): image not found), /usr/local/lib/php/pecl/20200930/pdo_firebird.so (dlopen(/usr/local/lib/php/pecl/20200930/pdo_firebird.so, 9): image not found)) in Unknown on line 0

And this similar error message on Ubuntu Linux:

PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_firebird' (tried: /usr/lib/php/20200930/pdo_firebird (/usr/lib/php/20200930/pdo_firebird: cannot open shared object file: No such file or directory), /usr/lib/php/20200930/pdo_firebird.so (/usr/lib/php/20200930/pdo_firebird.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

I don't have pdo_firebird file (and don't know where to get it from) and I'm using PHP 8.0 on both machines.

How should I fix this issue ?

Transaction Support

Hi, I tried to use the commands bellow:
DB::beginTransaction();
DB::insert("INSERT INTO ...");
DB::rollBack();

But the rollback didn't work, because the insertion happened.

Are the transactions working?

could not find driver

Hi,
i installed this package and set the database conf.
add the firebird driver in the database.php and change .env file.

database.php:
'connections' => [

    'firebird' => [
        'driver'   => 'firebird',
        'host'     => env('DB_HOST', 'localhost'),
        'database' => env('DB_DATABASE', '/path_to/database.fdb'),
        'username' => env('DB_USERNAME', 'sysdba'),
        'password' => env('DB_PASSWORD', 'masterkey'),
        'charset'  => env('DB_CHARSET', 'UTF8'),
    ],

.env:
DB_CONNECTION=firebird
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=C:\Users\Tirad1\Desktop\DATABASE.FDB
DB_USERNAME=SYSDBA
DB_PASSWORD=masterkey
DB_CHARSET=UTF8

but when i want connect the db i got the 'could not find driver' issue?
firebird 2.5, laravel 5.7, php 7.1 and php extension php_pdo_firebase is active.

Is there any setting other than these?

% wildcard counting in column length

I'm using Laravel 9 and I have a query that does a where like to a column varchar(14).

When the like has the full length of the column I get a error saying it expected 14 and got 16 characters.

Example: where document like '%12345678901234%'

When I do the same query in the console it works, but when the Laravel does it doesn't.

Is this behavior normal? I'm kinda new to Firebird...

Giving a bit more context:

Screenshot from 2023-06-08 17-40-05
Screenshot from 2023-06-08 17-39-47
Screenshot from 2023-06-08 17-40-24

Lastinsertid support?

I have a project with the original version of this driver by jacquestvanzuydam and it didn't support lastinsertid firebird function. I don't want to make changes just to try if this fork works with that. ¿Anyone knows if lastinsertid is working on this fork?
Reference: jacquestvanzuydam#25 (comment)

Thanks!

Job fails with PDOException: SQLSTATE[HY000]: General error: -902 connection shutdown

Hello, I have been encoutering this behavior for couple months now. Basically, I have a job that makes connection to firebird, selects or inserts in table. Like every 2nd job instantly fails. The job is very simple:

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        A_REPORT_MAILY::create($this->data);
    }

$this->data:

SQL: insert into "A_REPORT_MAILY" ("IDCISELPOD_UZIV_WEB", "ODESILATEL", "ADRESAT", "DATUMCAS", "PREDMET", "TELO", "TYP") values (18,[email protected], [email protected], 2022-06-08 16:26:13, Objednávka servisu stroje BT HWE 100, {"Firma:":"Auto SAS s.r.o.","N\u00e1zev stroje:":"BT HWE 100","V\u00fdrobn\u00ed \u010d\u00edslo:":"6443726","Eviden\u010dn\u00ed \u010d\u00edslo:":"S314","Nepoj\u00edzdn\u00fd:":"N","P\u0159es\u010das:":"N","Vypracovat cenovou nab\u00eddku:":"N","STK:":"N","Emise:":"N","TK:":"N","LPG\/CNG:":"N","Regenerace baterie:":"N","Revize plo\u0161iny:":"N","\u00dadr\u017eba - servis:":"A","Z\u00e1vada:":"N","Popis z\u00e1vady:":"Pros\u00edm o proveden\u00ed \u00fadr\u017eby stroje - po domluv\u011b s p.Toch\u00e1\u010dkem zkus\u00edme napl\u00e1novat i regeneraci bateri\u00ed. \nMF","\u010cas objedn\u00e1vky:":"08.06.2022 16:26"}, 1))

Payload:

{"uuid":"699332c6-b8c7-43a1-b78a-1572a706c40d","timeout":null,"id":"0bCGBJ9T5NxopF7BvcT3gxC5JfU3tPWN","backoff":null,"displayName":"App\\Jobs\\VytvorSouhrnnyReportJob","maxTries":null,"failOnTimeout":false,"maxExceptions":null,"retryUntil":null,"job":"Illuminate\\Queue\\CallQueuedHandler@call","data":{"command":"O:32:\"App\\Jobs\\VytvorSouhrnnyReportJob\":10:{s:3:\"job\";N;s:10:\"connection\";N;s:5:\"queue\";N;s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:19:\"chainCatchCallbacks\";N;s:5:\"delay\";N;s:11:\"afterCommit\";N;s:10:\"middleware\";a:0:{}s:7:\"chained\";a:0:{}}","commandName":"App\\Jobs\\VytvorSouhrnnyReportJob"},"attempts":2}

Exception:

PDOException: SQLSTATE[HY000]: General error: -902 connection shutdown  in /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:368
Stack trace:
#0 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(368): PDO->prepare()
#1 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(709): Illuminate\Database\Connection->Illuminate\Database\{closure}()
#2 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(676): Illuminate\Database\Connection->runQueryCallback()
#3 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\Database\Connection->run()
#4 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2556): Illuminate\Database\Connection->select()
#5 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2544): Illuminate\Database\Query\Builder->runSelect()
#6 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3078): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#7 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2545): Illuminate\Database\Query\Builder->onceWithColumns()
#8 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(675): Illuminate\Database\Query\Builder->get()
#9 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(659): Illuminate\Database\Eloquent\Builder->getModels()
#10 /www/hosting/sas-report.cz/www/app/Jobs/VytvorSouhrnnyReportJob.php(40): Illuminate\Database\Eloquent\Builder->get()
#11 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(29): App\Jobs\VytvorSouhrnnyReportJob->App\Jobs\{closure}()
#12 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(453): Illuminate\Database\Connection->transaction()
#13 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(337): Illuminate\Database\DatabaseManager->__call()
#14 /www/hosting/sas-report.cz/www/app/Jobs/VytvorSouhrnnyReportJob.php(42): Illuminate\Support\Facades\Facade::__callStatic()
#15 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Jobs\VytvorSouhrnnyReportJob->handle()
#16 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#17 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#18 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#19 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call()
#20 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\Container\Container->call()
#21 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#22 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#23 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#24 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(119): Illuminate\Bus\Dispatcher->dispatchNow()
#25 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}()
#26 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#27 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(121): Illuminate\Pipeline\Pipeline->then()
#28 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(69): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware()
#29 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\Queue\CallQueuedHandler->call()
#30 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(428): Illuminate\Queue\Jobs\Job->fire()
#31 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(378): Illuminate\Queue\Worker->process()
#32 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(172): Illuminate\Queue\Worker->runJob()
#33 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(126): Illuminate\Queue\Worker->daemon()
#34 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(110): Illuminate\Queue\Console\WorkCommand->runWorker()
#35 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#36 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#37 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#38 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#39 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call()
#40 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Container\Container->call()
#41 /www/hosting/sas-report.cz/www/vendor/symfony/console/Command/Command.php(291): Illuminate\Console\Command->execute()
#42 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()
#43 /www/hosting/sas-report.cz/www/vendor/symfony/console/Application.php(989): Illuminate\Console\Command->run()
#44 /www/hosting/sas-report.cz/www/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#45 /www/hosting/sas-report.cz/www/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#46 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\Component\Console\Application->run()
#47 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()
#48 /www/hosting/sas-report.cz/www/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#49 {main}

Next Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: -902 connection shutdown  (SQL: select * from "A_CISELPOD_ODP_OSOBA" where "MAILY_VSE" = A and "MAIL" is not null) in /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:716
Stack trace:
#0 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(676): Illuminate\Database\Connection->runQueryCallback()
#1 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\Database\Connection->run()
#2 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2556): Illuminate\Database\Connection->select()
#3 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2544): Illuminate\Database\Query\Builder->runSelect()
#4 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3078): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#5 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2545): Illuminate\Database\Query\Builder->onceWithColumns()
#6 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(675): Illuminate\Database\Query\Builder->get()
#7 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(659): Illuminate\Database\Eloquent\Builder->getModels()
#8 /www/hosting/sas-report.cz/www/app/Jobs/VytvorSouhrnnyReportJob.php(40): Illuminate\Database\Eloquent\Builder->get()
#9 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(29): App\Jobs\VytvorSouhrnnyReportJob->App\Jobs\{closure}()
#10 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(453): Illuminate\Database\Connection->transaction()
#11 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(337): Illuminate\Database\DatabaseManager->__call()
#12 /www/hosting/sas-report.cz/www/app/Jobs/VytvorSouhrnnyReportJob.php(42): Illuminate\Support\Facades\Facade::__callStatic()
#13 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Jobs\VytvorSouhrnnyReportJob->handle()
#14 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#15 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#16 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#17 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call()
#18 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\Container\Container->call()
#19 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#20 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#21 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#22 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(119): Illuminate\Bus\Dispatcher->dispatchNow()
#23 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}()
#24 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#25 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(121): Illuminate\Pipeline\Pipeline->then()
#26 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(69): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware()
#27 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\Queue\CallQueuedHandler->call()
#28 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(428): Illuminate\Queue\Jobs\Job->fire()
#29 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(378): Illuminate\Queue\Worker->process()
#30 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(172): Illuminate\Queue\Worker->runJob()
#31 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(126): Illuminate\Queue\Worker->daemon()
#32 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(110): Illuminate\Queue\Console\WorkCommand->runWorker()
#33 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#34 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#35 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#36 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#37 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call()
#38 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Container\Container->call()
#39 /www/hosting/sas-report.cz/www/vendor/symfony/console/Command/Command.php(291): Illuminate\Console\Command->execute()
#40 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()
#41 /www/hosting/sas-report.cz/www/vendor/symfony/console/Application.php(989): Illuminate\Console\Command->run()
#42 /www/hosting/sas-report.cz/www/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#43 /www/hosting/sas-report.cz/www/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#44 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\Component\Console\Application->run()
#45 /www/hosting/sas-report.cz/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()
#46 /www/hosting/sas-report.cz/www/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#47 {main}

Only reference I could find related to php: https://bugs.php.net/bug.php?id=64603&edit=1

Is this a bug with the driver or really a php-firebird issue that can't be fixed here?

laravel-firebird dialect 1

Hi,
Is annybody know is the harrygulliford driver working with firebird dialect 1.
This is differens, how sql interpreting query e.g.
SELECT * FROM "migration"
is ok in dialect 3 but in dialect 1 shoud be
SELECT * from migration.
If we execute SELECT * FROM RDB$RELATIONS WHERE RDB$RELATION_NAME = ?
parameter "?" shoud be uppercased

Best Regards
Wiesiek

Querys with exists and union all don't work

There is an error in sqls with exists and union all, so I would like you to add the two functions below to fix them, in Firebird2Grammar.php file:

public function compileExists(Builder $query)
{
    $select = $this->compileSelect($query);

    return "select 1 \"exists\" from ($select)";
}

protected function wrapUnion($sql)
{
    return $sql;
}

*Sorry for my english.

Char Vs Varchar - a strange "b" character

Schermata del 2022-07-08 14-45-17
"harrygulliford/laravel-firebird": "^3.1"
Laravel v9.16.0 (PHP v8.1.2)
Firebird 2.5.4 charset ISO8859_1

if I read a field (CPDES in screenshot) of type Char(50) (ISO8859_1) containing an accented character -> I find a "b" character antecedent to the string
if the field is a Varchar(200) (LECOM in screenshot) -> no problem

maybe missing a utf8_encode ?

Query error in database from another network device

PHP Pure no problem, I can see the query without problem.

        $query = "SELECT NOMBREVENDEDOR FROM VENDEDORES";
        $pdo = new PDO("firebird:dbname=192.168.1.245:bdservidor", "SYSDBA", "masterkey");
        $result = $pdo->query($query)->fetchAll(PDO::FETCH_ASSOC);
        dd($result);

With Laravel-Firebird

$result = DB::connection('firebird')->table('VENDEDORES')->select('*')->get();
dd($result);

ENV

DB_FIREBIRD_HOST=localhost
DB_FIREBIRD_PORT=3050
DB_FIREBIRD_DATABASE=192.168.1.245:bdservidor
DB_FIREBIRD_USERNAME=SYSDBA
DB_FIREBIRD_PASSWORD=masterkey
DB_FIREBIRD_CHARSET=UTF8

have error:

Illuminate\Database\QueryException
SQLSTATE[HY000] [335544375] unavailable database (SQL: select * from "VENDEDORES")

but if I query a database from the same computer I have no problems, but if it is a database from another network computer I cannot :(

Eloquent doesnt work correctly

When I do query, I cant't access attributes from my model.

I need to do json_decode($model) to access attributes from table:

image

But, when I do json_decode, I lost attributes from Eloquent, for example: save method.

How can I fix this?

Failed migrations on Laravel 6.x

first, I'm using Laravel 6.0, then tried to install laravel-firebird.
I've found some error :

  1. failed to migrations
        Schema::create('roles', function (Blueprint $table) {
            $table->useIdentity();
            $table->bigIncrements('id');
            $table->string('role_name')->unique();
            $table->boolean('all_branch')->default(false)->comment('access all branch');
            $table->boolean('is_active')->default(true);
            $table->timestamps();
        });

because on Firebird Grammer, while had default value, it's doesn't need NOT NULL again.

Thank you a lot.

Error getting table columns listing

When I check if a table exists in a Firebird(1.5) database:

Illuminate\Support\Facades\Schema::connection('my_connection')->hasTable('my_table');

I get true, it works fine.

However, when I check if a column exists in a table like this:

Illuminate\Support\Facades\Schema::connection('my_connection')->hasColumn('my_table', 'my_column');

I get the following error message:

Illuminate\Database\QueryException with message 'SQLSTATE[HY000]: General error: -804 Dynamic SQL Error SQL error code = -804 Function unknown TRIM  (SQL: SELECT TRIM(RDB$FIELD_NAME) AS "column_name" FROM RDB$RELATION_FIELDS WHERE RDB$RELATION_NAME = 'my_table')'

Is it a bug (or limitation) or am I using a wrong syntax ?

Is there an alternative to get column listing from eloquent model ?

Problem with date

DB::connection('firebird')->select("SELECT * from "S" where "DATA" > '01.01.2020'");

work correctly

DB::connection('firebird')->table('S')->where('DATA', '>', ''01.01.2020'')->get();

not work

I have tried 01.01.2020 and "01.01.2020" but got the same error

SQLSTATE[HY000]: General error: -303 Dynamic SQL Error SQL error code = -303 arithmetic exception, numeric overflow, or string truncation (SQL: select * from "S" where "DATA" > '01.01.2020')
or 01.01.2020 or "01.01.2020"

Querys with double quotes

The driver creates the queries with double quotes, causing a crash. Example:

DB::table('fases_de_produc')->where('id_fase', $id_fase)->first();

SQLSTATE[HY000]: General error: -204 Dynamic SQL Error SQL error code = -204 Table unknown fases_de_produc At line 1, column 23
SELECT
FIRST 1 *
FROM
"fases_de_produc"
WHERE
"id_fase" = 60

I know that it does not comply with the conventions, it is an old, pre-existing database. Thank u.

Illuminate\Database\QueryException could not find driver

Trying to do a simple query, just to test if the connection with Firebird database works, and got the following error.
"Illuminate\Database\QueryException could not find driver". Already have the firebird extension enabled on PHP and fbclient.dll on the PHP folder, what could it be?

Queues with Firebird

Hi,

I need use Laravel Queues, and the driver 'database' is the best option to me, but this package not work with migrations. So the commands:
php artisan queue:table
php artisan migrate
are not working.

Has anyone faced this or can help me?

Thanks.

Json response in Laravel with fields adding underscores

In a laravel query where there is a relationship between belongsTo articles and their section, family and subfamily, I get this result:
"code": 200,

"data": {
      "CODIGO": "501",
      "NOMBRE": "CAJA 30",
      "SECCION": "PTC",
      "FAMILIA": "00-13",
      "SUBFAMILIA": "67",
      "MARCA": "1",
      "TIPO_IVA": 2,
      "BAJA": "N   ",
      "ACTUALIZA_PVP": "S   ",
      "PUBLICAR_WEB": "S   ",
      "s_e_c_c_i_o_n": {
          "CODIGO": "PTC",
          "DESCRIPCION": "CAJAS COMPUESTAS"
      },
      "f_a_m_i_l_i_a": {
          "CODIGO": "00-13",
          "DESCRIPCION": "STATICE"
      },
      "s_u_b_f_a_m_i_l_i_a": {
          "CODIGO": "67",
          "DESCRIPCION": "STATICE EXTRA"
      }
  }

As you can see, I get the results I need, but in addition to duplicating the section, family and subfamily fields, I also change their name by adding underscores between the letters.

Can this be solved? Thank you.

How to configure in Lumen?

I'm trying to install the package on Lumen 7 and I'm not getting it. I also need to say that I'm new to Lumen.

What I've done so far:
1- I installed the package via Composer: "composer require harrygulliford / laravel-firebird"
2- I created a config folder containing the database.php file as in Laravel
3- I changed Lumen's app.php to read the file: $ app-> configure ('database');
4- I created a model and defined the connection: protected $ connection = 'firebird';

However the application returns the error to me: Unsupported driver [firebird]

What should I do?

Using Firebird for jobs - driver doesn't support lastInsertId()

Hello I would like to use a firebird database for queued jobs, migration was successful, but when inserting to the table, I get error:

SQLSTATE[IM001]: Driver does not support this function: driver does not support lastInsertId()

With models, I was able to call the database sequence generator, but this is code of laravel that I know I should never alter. Is it possible to have jobs in firebird?

Method HarryGulliford\Firebird\Schema\Grammars\FirebirdGrammar::compileColumns does not exist.

After updating to Laravel 10 I am getting this error. I have a trait Excludable, which maps the table columns and creates a scope that helps me exclude some columns from the table instead of selecting all others.

<?php

namespace App\Traits;

trait Excludable
{
    /**
     * Get the array of columns
     *
     * @return mixed
     */
    private function getTableColumns()
    {
        return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());
    }

    /**
     * Exclude an array of elements from the result.
     *
     * @return mixed
     */
    public function scopeExclude($query, $columns)
    {
        return $query->select(array_diff($this->getTableColumns(), (array) $columns));
    }
}

The problem occurs when calling ->getColumnListing($this->getTable()) , easily reproduceable.

Use for Interbase database connection

Hello,
I'm using Laravel 9 and trying to connect to the Interbase database. It seems that this package is not able to do this. I'm getting connection rejected by remote interface I have no problems connecting to a Firebird database with the same setup.

Please, tell me if I can use this package to connect to Interbase database. Maybe I have a mistake somewhere. Or I should use another package/approach?

Thank you in advance!

Implementation limit exceeded block size exceeds implementation restriction

I am trying to run the following query:

select count(distinct "TICKETS"."ID") as "aggregate" from "TICKETS" inner join "HISTORICO" on "TICKETS"."ID" = "HISTORICO"."TICKETID" inner join "MAR_EMP" on "TICKETS"."CLIENTEID" = "MAR_EMP"."EMP_CODIGO" inner join "USER_DATA" on "TICKETS"."ATRIBUIDOID" = "USER_DATA"."ID" where "TICKETS"."PRIORIDADE" in ('Baixa', 'Alta') and "TICKETS"."STATUS" = 'Andamento' and ( upper( "TICKETS"."ASSUNTO" collate DE_DE) like '%CHANANAN%' or upper( "TICKETS"."DESCRICAO" collate DE_DE) like '%CHANANAN%' or upper( "HISTORICO"."DESCRICAO" collate DE_DE) like '%CHANANAN%' ) and "MAR_EMP"."EMP_NOMEMP" = 'SULEICA SCHUH' and "USER_DATA"."NOME" = 'gabriel'

But this is giving me the following error:

["SQLSTATE[HY000]: General error: -204 Dynamic SQL Error SQL error code = -204 Implementation limit exceeded block size exceeds implementation restriction

but when I run directly on IBExpert it runs perfectly.

Pagination issue

I upgraded to Laravel 9 in one of my projects and am getting Undefined property: stdClass::$aggregate when applying pagination:

row 2660 in vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php

public function getCountForPagination($columns = ['*'])
    {
        $results = $this->runPaginationCountQuery($columns);

        // Once we have run the pagination count query, we will get the resulting count and
        // take into account what type of query it was. When there is a group by we will
        // just return the count of the entire results set since that will be correct.

        if (! isset($results[0])) {
            return 0;
        } elseif (is_object($results[0])) {
            return (int) $results[0]->aggregate;     <-------- Here is exception Undefined property: stdClass::$aggregate
        }

        return (int) array_change_key_case((array) $results[0])['aggregate'];
    }

$results[0] in version ^2.3 is:

{ 
   aggregate => 0
}

But for some reason, in version ^3.0 is:

{ 
   AGGREGATE => 0
}

This fixes the issue:

return isset($results[0]->AGGREGATE) ? (int) $results[0]->AGGREGATE : (int) $results[0]->aggregate;

But I'm literally changing core laravel...

Could anything be done about this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.