You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
Does SQL generally have any restrictions on what characters can be used as a 'key' here? IPFS likes to use raw hashes as the keys, i'm not sure how well that would work here. Any ideas @b5 ?
The text was updated successfully, but these errors were encountered:
Currently this package is BYO key storage / retrieval, and most (all?) SQL implementations (Postgres, MySQL, Sqlite) will let you store raw byte arrays. Those two things combined should make working with raw hashes no problem.
As an example, we're storing metadata objects by multihash here, with the schema definition for the metadata model here.
You'll notice the schema def uses a text type, that could just as easily be a bytea capped to the exact length of the hash in the db. Translation from bytes into into a go type would happen in the UnmarshalSQL method . I've chosen to store it as a string because datastore.Key.Name() returns a string, and, you know, laziness.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Does SQL generally have any restrictions on what characters can be used as a 'key' here? IPFS likes to use raw hashes as the keys, i'm not sure how well that would work here. Any ideas @b5 ?
The text was updated successfully, but these errors were encountered: