laravel-adjacency-list icon indicating copy to clipboard operation
laravel-adjacency-list copied to clipboard

Support to Firebird

Open gssj85 opened this issue 1 year ago • 4 comments

Hi,

I would like to contribute with support to Firebird however this would be my very first contribution I'm not sure where to start, I'm a mid-level developer but with some guidance I could make the adjustments to add Firebird, they look minor.

gssj85 avatar Sep 15 '23 21:09 gssj85

Hi @gssj85, The first step would be to add support for Firebird to the underlying CTE package: https://github.com/staudenmeir/laravel-cte

Are you using https://github.com/harrygulliford/laravel-firebird to connect to Firebird?

staudenmeir avatar Sep 15 '23 23:09 staudenmeir

Hi @gssj85, The first step would be to add support for Firebird to the underlying CTE package: https://github.com/staudenmeir/laravel-cte

Are you using https://github.com/harrygulliford/laravel-firebird to connect to Firebird?

Thanks for the guidance and yes I'm using https://github.com/harrygulliford/laravel-firebird

gssj85 avatar Sep 16 '23 03:09 gssj85

Just in the last few weeks, the CTE package added support for new database drivers. Take inspiration from them: https://github.com/staudenmeir/laravel-cte/pull/48/files https://github.com/staudenmeir/laravel-cte/pull/50/files

staudenmeir avatar Sep 16 '23 08:09 staudenmeir

And let me know if you have any questions.

staudenmeir avatar Sep 17 '23 18:09 staudenmeir

https://github.com/staudenmeir/laravel-cte/issues/54

staudenmeir avatar Mar 02 '24 21:03 staudenmeir

What part of the package would you like to use with Firebird? Trees or graphs?

staudenmeir avatar Mar 06 '24 14:03 staudenmeir

What part of the package would you like to use with Firebird? Trees or graphs?

I did implement "manually" the tree functionality I needed, the crucial logic I got from your lib by inspecting the code (thank you very much).

If I can suggest I think it's most important to get the CTE working first, look at what I had to do without laravel-cte haha:

return '(WITH '
            . "conta_receber_query AS ($conta_receber), "
            . "conta_pagar_query AS ($conta_pagar)"
            . PHP_EOL
            . "$acrescimo_desconto) as CONTAS";

Whhere the queries sql were added using:

Str::replaceArray('?', $query->getBindings(), $query->toSql())

I put that inside a ->from()

But if you can get this working too, kudos to you, just think the most "urgent" is the CTE...

edit: taking a second look this post doesn't really add to the subject, just wanted you to know, you can delete it after reading no problem!

gssj85 avatar Mar 06 '24 14:03 gssj85

I've released a new version with support for Firebird.

staudenmeir avatar Mar 08 '24 13:03 staudenmeir

Nice, thank you. Unfortunatelly I'm on Laravel 9 still so no CTE to me hehe but I think we will be upgrading the project to 10 or 11 "soon". =)

gssj85 avatar Mar 08 '24 13:03 gssj85