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
Jsonb support #94
Comments
As zzzeek/sqlalchemy#145 has been merged, sth can be done in order to solve this issue. If you want, I can create a PR, just tell me how would you like to have it solved. |
For reference: http://stackoverflow.com/questions/22654170/explanation-of-jsonb-introduced-by-postgresql Unless you're hand-writing SQL I see no advantage to Unless @kvesteri has a better idea, I'd recommend (in your own codebase): class JSONBType(JSONType):
def load_dialect_impl(self, dialect):
return JSONB() However if you could write queries to keys inside a |
Please check zzzeek/sqlalchemy#101 . The operators have been already implemented in |
Hmm.. Well, then. Thank you for pointing that out to me. I'd recommend something describing what using |
Your welcome. It was easy to overlook, I believe this feature wasn't advertised at all. I'm not sure if |
Whatever we do, this, makes me want to make After taking some time to read that document from |
What about a quiet fallback? For example |
It wouldn't make sense to fallback to |
I just have one doubt. When sb uses this library and types implemented here, he usually has a software which is not database engine dependant. When such developer has an class MyModel(declarative_base()):
my_column = Column(JSON(binary=True), primary_key=True) It will result in weird, exploding behaviour on engines different than |
I completely agree with you there which is why I'm suggesting the |
Wouldn't it be better to:
|
Continuing discussion in #125 |
SQLAlchemy will have native JSON type as of 1.1. I'll deprecate and remove JSONType from SA-Utils at some point. |
The problem with native JSON type, it doesn't have fallback to text
|
Hello!
Lately PostgreSQL introduced new field type:
jsonb
. It is designed to allow querying specific fields inside json dictionaries. http://www.postgresql.org/docs/9.4/static/functions-json.html . It is a significant performance improvement over the old implementationThe support for the field is already implemented in SQLAlchemy. Shouldn't
sqlalchemy-utils
support it as a part ofJSONType
?JSONType
could take an optional argument which would define which field type is requested if the Postgres is being used.The text was updated successfully, but these errors were encountered: