@@ -4170,22 +4170,22 @@ public function testWhereJsonLengthPostgres()
4170
4170
{
4171
4171
$ builder = $ this ->getPostgresBuilder ();
4172
4172
$ builder ->select ('* ' )->from ('users ' )->whereJsonLength ('options ' , 0 );
4173
- $ this ->assertSame ('select * from "users" where json_array_length (("options")::json ) = ? ' , $ builder ->toSql ());
4173
+ $ this ->assertSame ('select * from "users" where jsonb_array_length (("options")::jsonb ) = ? ' , $ builder ->toSql ());
4174
4174
$ this ->assertEquals ([0 ], $ builder ->getBindings ());
4175
4175
4176
4176
$ builder = $ this ->getPostgresBuilder ();
4177
4177
$ builder ->select ('* ' )->from ('users ' )->whereJsonLength ('users.options->languages ' , '> ' , 0 );
4178
- $ this ->assertSame ('select * from "users" where json_array_length (("users"."options"-> \'languages \')::json ) > ? ' , $ builder ->toSql ());
4178
+ $ this ->assertSame ('select * from "users" where jsonb_array_length (("users"."options"-> \'languages \')::jsonb ) > ? ' , $ builder ->toSql ());
4179
4179
$ this ->assertEquals ([0 ], $ builder ->getBindings ());
4180
4180
4181
4181
$ builder = $ this ->getPostgresBuilder ();
4182
4182
$ builder ->select ('* ' )->from ('users ' )->where ('id ' , '= ' , 1 )->orWhereJsonLength ('options->languages ' , new Raw ('0 ' ));
4183
- $ this ->assertSame ('select * from "users" where "id" = ? or json_array_length (("options"-> \'languages \')::json ) = 0 ' , $ builder ->toSql ());
4183
+ $ this ->assertSame ('select * from "users" where "id" = ? or jsonb_array_length (("options"-> \'languages \')::jsonb ) = 0 ' , $ builder ->toSql ());
4184
4184
$ this ->assertEquals ([1 ], $ builder ->getBindings ());
4185
4185
4186
4186
$ builder = $ this ->getPostgresBuilder ();
4187
4187
$ builder ->select ('* ' )->from ('users ' )->where ('id ' , '= ' , 1 )->orWhereJsonLength ('options->languages ' , '> ' , new Raw ('0 ' ));
4188
- $ this ->assertSame ('select * from "users" where "id" = ? or json_array_length (("options"-> \'languages \')::json ) > 0 ' , $ builder ->toSql ());
4188
+ $ this ->assertSame ('select * from "users" where "id" = ? or jsonb_array_length (("options"-> \'languages \')::jsonb ) > 0 ' , $ builder ->toSql ());
4189
4189
$ this ->assertEquals ([1 ], $ builder ->getBindings ());
4190
4190
}
4191
4191
0 commit comments