Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Hyperdb #2

Merged
merged 5 commits into from
Feb 10, 2025
Merged

Switch to Hyperdb #2

merged 5 commits into from
Feb 10, 2025

Conversation

supersuryaansh
Copy link
Collaborator

No description provided.

index.js Outdated
@@ -105,6 +114,34 @@ class Autopass extends ReadyResource {
this.pairing = null
this.replicate = opts.replicate !== false
this.debug = !!opts.key
// Register handlers for commands
this.router.add('@autopass-namespace/removeWriter', async (data, context) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the -namespace is redundant, just @autopass/remove-writer

index.js Outdated
// Register handlers for commands
this.router.add('@autopass-namespace/removeWriter', async (data, context) => {
await context.base.removeWriter(data.key)
return { success: true }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont return anything

index.js Outdated

this.router.add('@autopass-namespace/put', async (data, context) => {
await context.view.insert('@autopass-namespace/autopass', data)
await context.view.flush()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the flush to the apply call post router dispatch, same for all flushes

index.js Outdated
if (node === null) return null
return node.value
const queryStreams = await this.base.view.get('@autopass-namespace/autopass', { key })
const data = await queryStreams
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes no sense, just data = await this....get(...)

schema.js Outdated

// SCHEMA CREATION START //
const schemaTemplate = Hyperschema.from('./spec/schema')
const templateNamespace = schemaTemplate.namespace('autopass-namespace')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name this autopass vs template...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by this?

index.js Outdated
@@ -173,6 +165,7 @@ class Autopass extends ReadyResource {
for (const node of nodes) {
await this.router.dispatch(node.value, { view, base })
}
view.flush()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await

@mafintosh mafintosh merged commit 3bcc74b into main Feb 10, 2025
3 checks passed
@mafintosh mafintosh deleted the hyperdb branch February 10, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants