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

Outerbase Raw Endpoint Not Returning Errors For Cloudflare D1 #41

Open
caleb-mabry opened this issue Jul 5, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working internal

Comments

@caleb-mabry
Copy link
Contributor

caleb-mabry commented Jul 5, 2024

Describe the bug
When trying to fix #33 the Outerbase API does not return any errors. I'm specifically working with an API key that is attached to a Cloudflare D1 interface.

Outerbase API said {
  success: true,
  response: {
    query: 'update table egg where egg = "egg"',
    results: { schema: false, items: [], count: 0 }
  }
}

I do not have a table called egg and this query should have issues. It also seems to be confusing because there is a success:true but the status code 200 should already let us know that it was OK.

To Reproduce
Steps to reproduce the behavior:
Update outerbase.ts to console log the response from the query function.
https://github.com/outerbase/sdk/blob/main/src/connections/outerbase.ts#L126-L128

        let json = await response.json()
        let error = null
        console.log('Outerbase API said', json)
import {OuterbaseConnection} from './src/connections/outerbase'
import {Outerbase} from './src/client'
const connection = new OuterbaseConnection({apiKey: 'YOUR-API-KEY-HERE'})
const outerbase = Outerbase(connection);


(async () => {
    const response = await outerbase.queryRaw('update table egg where egg = "egg"')
    console.log('Response from IIFE', response)
})()

Expected behavior
I would expect Outerbase to let me know there is an error in my query but it silently fails.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
Add any other context about the problem here.

@caleb-mabry caleb-mabry added bug Something isn't working internal labels Jul 5, 2024
@erikkristoferanderson
Copy link

I'm watching this one.

@caleb-mabry
Copy link
Contributor Author

Should hopefully be working on this one here today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal
Projects
None yet
Development

No branches or pull requests

3 participants