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

CBOR implementation and HTTP connection engine #153

Merged
merged 29 commits into from
Oct 9, 2024

Conversation

remade
Copy link
Collaborator

@remade remade commented Oct 8, 2024

This PR introduces the HTTP connection engine, complementing the existing WebSocket engine, allowing users to choose their preferred connection type (HTTP or WebSocket) based on their needs.

Additionally, the communication encoding has been switched from JSON to CBOR. This change enables more robust data handling, providing richer type information during communication between the client and SurrealDB. By eliminating the need for the previous smart marshalling/unmarshalling logic, CBOR ensures precise handling of data types, aligning with both user requests and the SurrealDB service responses.

Key Changes

  • Added HTTP connection engine alongside the existing WebSocket engine.
  • Switched data encoding from JSON to CBOR for improved type accuracy and consistency.
  • Changed DML functions to allow db injection and generic constraints for results
  • Updated all integration tests

@remade remade merged commit 5bbb7b1 into main Oct 9, 2024
2 checks passed
```
Where surrealdb.O is defined below. There is no special advantage in using this other than simplicity/legibility.
```go
type surrealdb.O map[interface{}]interface{}

Choose a reason for hiding this comment

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

Can I suggest something other than 0? It's very unclear whether it is 0 or O.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nickchomey I see what you mean. Maybe something like .Obj?

Choose a reason for hiding this comment

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

@remade

Obj would be better
Other ideas:

  • ObjMap
  • sdbObj
  • Map
  • Template

Not sure....

@remade remade deleted the cbor-encoding-and-http-connection-engine branch October 25, 2024 07:59
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.

5 participants