laravel-nestedset icon indicating copy to clipboard operation
laravel-nestedset copied to clipboard

not worked for Postgresql?

Open niunaiyi opened this issue 5 years ago • 2 comments

when i use withDepth()->find($id), somethin wrong happend; i noted strict mode,but my db is Postgresql.

@niuny-mb ljfl-api % php artisan tinker Psy Shell v0.9.12 (PHP 7.3.9 — cli) by Justin Hileman

$area = Area::withDepth()->find(24); [!] Aliasing 'Area' to 'App\Models\Area' for this Tinker session. Illuminate/Database/QueryException with message 'SQLSTATE[42803]: Grouping error: 7 ERROR: column "_d.name" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: ...lft" between "_d"."_lft" and "_d"."_rgt" order by "name" asc... ^ (SQL: select *, (select count(1) - 1 from "areas" as "_d" where "areas"."_lft" between "_d"."_lft" and "_d"."_rgt" order by "name" asc) as "depth" from "areas" where "areas"."id" = 24 order by "name" asc limit 1)'

niunaiyi avatar Dec 30 '19 07:12 niunaiyi

This is also doesn't work with sqlite

hlorofos avatar Mar 12 '21 15:03 hlorofos

Same problem!

kurucu avatar Sep 09 '22 10:09 kurucu