Skip to content

Add eval-many and tests#30

Open
veqqq wants to merge 5 commits into
janet-lang:masterfrom
veqqq:master
Open

Add eval-many and tests#30
veqqq wants to merge 5 commits into
janet-lang:masterfrom
veqqq:master

Conversation

@veqqq

@veqqq veqqq commented Jul 19, 2026

Copy link
Copy Markdown

I finally realized that assert errs driving jpm test!

@sogaiu

sogaiu commented Jul 22, 2026

Copy link
Copy Markdown

Worth checking the return values of the following?

Their signatures suggest return values of int, not void.

@veqqq

veqqq commented Jul 22, 2026

Copy link
Copy Markdown
Author

return values of int

I'm not sure what to return (such that it's meaningful). sqlite3_reset only pushes sqlite3_step's return through which in the success path is SQLITE_OK (nothing else gets to reset). Do you think it should just emit SQLITE_OK?

@veqqq

veqqq commented Jul 22, 2026

Copy link
Copy Markdown
Author

I added a benchmark and fixed doc string formating

@veqqq

veqqq commented Jul 23, 2026

Copy link
Copy Markdown
Author

I still feel pretty new to c and just broke some prior beliefs where I thought: 0 is success, -1 is err everywhere but that's apparently only POSIX. E.g. SQLITE_BUSY is e.g. 5 or SQLITE_ROW 100. So they're giving actual values here

My intuition suggests not returning anything on the base case, since this is just for the side effect of writing.

execute and bindmany and bind1 return null on success. But they're not userfacing exactly.

@sogaiu

sogaiu commented Jul 23, 2026

Copy link
Copy Markdown

I don't have a detailed understanding of sqlite3 C bits, but I noticed this document which has the prose:

Many of the routines in the SQLite C-language Interface return numeric result codes indicating either success or failure, and in the event of a failure, providing some idea of the cause of the failure. This document strives to explain what each of those numeric result codes means.

Very roughly speaking, it seems reasonable to try to detect if there is an error after each of the sqlite3_* functions that can indicate errors via their return values. The idea is that one would probably want to know if something did not go as planned.

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