You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to do a system of client db with pglite, and server db with postgres. And I want to share schema and models between client and server. So I create a model like this:
it works correctly in the server db as it should be. But in the client service, it just show an error:
TS2345: Argument of type
PgliteDatabase<typeof import(" lobe-chat/ src/ database/ schemas/ index")> & { $client: PGlite; }
is not assignable to parameter of type LobeChatDatabase
The types of _.session are incompatible between these types.
Type 'PgSession<PgliteQueryResultHKT, typeof import(" lobe-chat/ src/ database/ schemas/ index"), ExtractTablesWithRelations<typeof import(" lobe-chat/ src/ database/ schemas/ index")>>' is not assignable to type 'PgSession<NeonQueryResultHKT, typeof import(" lobe-chat/ src/ database/ schemas/ index"), ExtractTablesWithRelations<typeof import(" lobe-chat/ src/ database/ schemas/ index")>>'.
Type PgliteQueryResultHKT is not assignable to type NeonQueryResultHKT
Types of property type are incompatible.
Type Results<{ [key: string]: any; }> is missing the following properties from type QueryResult<QueryResultRow>: command, rowCount, oid
it shows that command, rowCount, oid key is not in the PgliteQueryResult
Is this a bug or by design? I thought it shouldn't be difference in query result between pglite and postgres, am I wrong?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to do a system of client db with pglite, and server db with postgres. And I want to share schema and models between client and server. So I create a model like this:
And in the server side, I can init server db and pass the instance to model like this:
And in the client side, I want to use same way:
now the core issue is that I defined the
LobeChatDatabase
:it works correctly in the server db as it should be. But in the client service, it just show an error:
it shows that
command, rowCount, oid
key is not in thePgliteQueryResult
Is this a bug or by design? I thought it shouldn't be difference in query result between pglite and postgres, am I wrong?
Thanks for help.
Beta Was this translation helpful? Give feedback.
All reactions