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

What is the params argument for in the C library? #227

Open
crystalthoughts opened this issue Jan 5, 2024 · 1 comment
Open

What is the params argument for in the C library? #227

crystalthoughts opened this issue Jan 5, 2024 · 1 comment

Comments

@crystalthoughts
Copy link

Hi, there doesn't seem to be any documentation for what 'parameters' are expected by the API.

I was looking for a way to limit or prevent returning very large strings after a large data input query. One might assume this might be a passed param, but perhaps it means something different.

Could you advise on the above? Thanks

@swdunlop
Copy link

It appears to be a JSON encoded map, looking at cozo.go which wraps the C library for Go. That said, the cozo_test.go doesn't actually use this at all -- so it is not obvious to me what this from either the C or Go wrappers.

The Python wrapper, however, has this:

res = client.run('?[] <- [[$name]]', {'name': 'Python'})

And that probably is enough of an example to figure it out. The parameters are a JSON object whose fields you can reference from Cozoscript to parameterize a query.

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

No branches or pull requests

2 participants