-
Notifications
You must be signed in to change notification settings - Fork 929
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DataConnect + PGLite prototype. (#7615)
* Hacking away at pglite+dataconnect emulator * Hacking away at it * More debugging * I THINK IT WORKSSSSS * Saving my progress at EoD * --amend * Progress * clean up * formatting * Use extended query patch (thanks @gregnr!) * Format and merge master * PR fixes * Remove JSON comments * format * Fxing test compilation issues * Cleaning up build issues * PR fixes * Format and generate json schema * Patching in missing types for VSCode builds * More type fixing * More type fixing * Little bit mroe code review * Removed unused dep * More pr fixes * test:emualtors build fixed * PR fixes * Fix port disagreement
- Loading branch information
Showing
41 changed files
with
2,566 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
}, | ||
"include": [ | ||
"../../src/**/*", | ||
"*", | ||
] | ||
"../../src/*", | ||
"./*", | ||
], | ||
"exclude": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
The code in this directory is a very slightly modified version of https://github.com/supabase-community/pg-gateway/tree/next. | ||
Full credit for this code goes to @gregnr and the other contributors on that repo. | ||
|
||
Due to some known issues with how PGLite handles prepared statements, this versiom of pg-gateway includes middleware | ||
to remove the extra Ready for Query messages that break schema migration. Once these underlying issues with PGLite are fixed, | ||
we'll migrate to a normal dependency on pg-gateway. |
34 changes: 34 additions & 0 deletions
34
src/emulator/dataconnect/pg-gateway/auth/base-auth-flow.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { BufferReader } from '../buffer-reader'; | ||
import type { BufferWriter } from '../buffer-writer'; | ||
import type { ConnectionSignal } from '../connection'; | ||
import type { ConnectionState } from '../connection.types'; | ||
|
||
type BufferSource = ArrayBufferView | ArrayBuffer; | ||
|
||
export interface AuthFlow { | ||
createInitialAuthMessage(): Uint8Array | undefined; | ||
handleClientMessage(message: BufferSource): AsyncGenerator<Uint8Array | ConnectionSignal>; | ||
isCompleted: boolean; | ||
} | ||
|
||
export abstract class BaseAuthFlow implements AuthFlow { | ||
protected reader: BufferReader; | ||
protected writer: BufferWriter; | ||
protected connectionState: ConnectionState; | ||
|
||
constructor(params: { | ||
reader: BufferReader; | ||
writer: BufferWriter; | ||
connectionState: ConnectionState; | ||
}) { | ||
this.reader = params.reader; | ||
this.writer = params.writer; | ||
this.connectionState = params.connectionState; | ||
} | ||
|
||
abstract createInitialAuthMessage(): Uint8Array | undefined; | ||
abstract handleClientMessage( | ||
message: BufferSource, | ||
): AsyncGenerator<Uint8Array | ConnectionSignal>; | ||
abstract get isCompleted(): boolean; | ||
} |
Oops, something went wrong.