@@ -52,7 +52,7 @@ export class PlaygroundService extends Effect.Service<PlaygroundService>()("Play
5252 ( eb ) =>
5353 eb
5454 . selectFrom ( "app_public.playground_stars" )
55- . select ( ( eb ) => [ "playground_hash" , eb . fn . countAll < string > ( ) . as ( "stars" ) ] )
55+ . select ( ( eb ) => [ "playground_hash" , eb . fn . countAll < bigint > ( ) . as ( "stars" ) ] )
5656 . groupBy ( "playground_hash" )
5757 . as ( "star_counts" ) ,
5858 ( join ) => join . onRef ( "star_counts.playground_hash" , "=" , "p.hash" ) ,
@@ -65,7 +65,7 @@ export class PlaygroundService extends Effect.Service<PlaygroundService>()("Play
6565 "p.fork_hash" ,
6666 "p.name" ,
6767 "p.description" ,
68- eb . fn . coalesce ( eb . ref ( "star_counts.stars" ) , sql . lit ( "0" ) ) . as ( "stars" ) ,
68+ eb . fn . coalesce ( eb . ref ( "star_counts.stars" ) , sql . lit ( 0n ) ) . as ( "stars" ) ,
6969 "p.created_at" ,
7070 "p.updated_at" ,
7171 ] ) ,
@@ -82,7 +82,7 @@ export class PlaygroundService extends Effect.Service<PlaygroundService>()("Play
8282 ( eb ) =>
8383 eb
8484 . selectFrom ( "app_public.playground_stars" )
85- . select ( ( eb ) => [ "playground_hash" , eb . fn . countAll < string > ( ) . as ( "stars" ) ] )
85+ . select ( ( eb ) => [ "playground_hash" , eb . fn . countAll < bigint > ( ) . as ( "stars" ) ] )
8686 . groupBy ( "playground_hash" )
8787 . as ( "star_counts" ) ,
8888 ( join ) => join . onRef ( "star_counts.playground_hash" , "=" , "p.hash" ) ,
@@ -94,7 +94,7 @@ export class PlaygroundService extends Effect.Service<PlaygroundService>()("Play
9494 "p.fork_hash" ,
9595 "p.name" ,
9696 "p.description" ,
97- eb . fn . coalesce ( eb . ref ( "star_counts.stars" ) , sql . lit ( "0" ) ) . as ( "stars" ) ,
97+ eb . fn . coalesce ( eb . ref ( "star_counts.stars" ) , sql . lit ( 0n ) ) . as ( "stars" ) ,
9898 "p.created_at" ,
9999 "p.updated_at" ,
100100 jsonBuildObject ( { username : eb . ref ( "u.username" ) } ) . as ( "user" ) ,
@@ -114,7 +114,7 @@ export class PlaygroundService extends Effect.Service<PlaygroundService>()("Play
114114 ( eb ) =>
115115 eb
116116 . selectFrom ( "app_public.playground_stars" )
117- . select ( ( eb ) => [ "playground_hash" , eb . fn . countAll < string > ( ) . as ( "stars" ) ] )
117+ . select ( ( eb ) => [ "playground_hash" , eb . fn . countAll < bigint > ( ) . as ( "stars" ) ] )
118118 . groupBy ( "playground_hash" )
119119 . as ( "star_counts" ) ,
120120 ( join ) => join . onRef ( "star_counts.playground_hash" , "=" , "p.hash" ) ,
@@ -146,7 +146,7 @@ export class PlaygroundService extends Effect.Service<PlaygroundService>()("Play
146146 "p.fork_hash" ,
147147 "p.name" ,
148148 "p.description" ,
149- eb . fn . coalesce ( eb . ref ( "star_counts.stars" ) , sql . lit ( "0" ) ) . as ( "stars" ) ,
149+ eb . fn . coalesce ( eb . ref ( "star_counts.stars" ) , sql . lit ( 0n ) ) . as ( "stars" ) ,
150150 "p.created_at" ,
151151 "p.updated_at" ,
152152 jsonBuildObject ( { username : eb . ref ( "u.username" ) } ) . as ( "user" ) ,
@@ -197,7 +197,7 @@ export class PlaygroundService extends Effect.Service<PlaygroundService>()("Play
197197 ( eb ) =>
198198 eb
199199 . selectFrom ( "app_public.playground_stars" )
200- . select ( ( eb ) => [ "playground_hash" , eb . fn . countAll < string > ( ) . as ( "stars" ) ] )
200+ . select ( ( eb ) => [ "playground_hash" , eb . fn . countAll < bigint > ( ) . as ( "stars" ) ] )
201201 . groupBy ( "playground_hash" )
202202 . as ( "star_counts" ) ,
203203 ( join ) => join . onRef ( "star_counts.playground_hash" , "=" , "p.hash" ) ,
@@ -210,7 +210,7 @@ export class PlaygroundService extends Effect.Service<PlaygroundService>()("Play
210210 . selectAll ( "p" )
211211 . select ( ( eb ) => [
212212 jsonBuildObject ( { username : eb . ref ( "u.username" ) } ) . as ( "user" ) ,
213- eb . fn . coalesce ( eb . ref ( "star_counts.stars" ) , sql . lit ( "0" ) ) . as ( "stars" ) ,
213+ eb . fn . coalesce ( eb . ref ( "star_counts.stars" ) , sql . lit ( 0n ) ) . as ( "stars" ) ,
214214 eb ( "my_star.playground_hash" , "is not" , null ) . $castTo < boolean > ( ) . as ( "is_starred" ) ,
215215 eb
216216 . case ( )
0 commit comments