qiboteam / qibodb Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Add subcommand to update the relation between package versions (essentially add new versions, or modify the supersedes
key).
There are collections in which it makes sense not to insert records, if a certain value is already contained.
E.g. the package
collection, for which it does not make sense to have multiple entries for the same version.
In SQL the UNIQUE
attribute is doing exactly this. There should be a way to do it even in MongoDB, let's just check if it's convenient, or better to manually search.
https://www.mongodb.com/docs/manual/core/index-unique/
https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.create_index
It should be possible to write meaningful unit tests with pytest-mongodb
(and some even stand-alone).
Moreover, thanks to the container server, it should be possible to run full integration tests on any platform which provides podman
and a web connection.
pytest-mongodb
As in #6 an update variant of insert classes is described, a further read variant should be generated.
In particular, the only additional information should be:
id
ctime
It would be rather useful to return objects, rather than dict
s, to the packages directly consuming Qibodb in Python (of course for CLI dict
s are perfectly fine).
It has native Git-like features (versioning, diff, ...) and graph queries.
Unfortunately, there is a bunch of duplication involved in inserting and retrieving information from the DB.
You could get a grasp for this from a simple (official) example:
https://www.mongodb.com/developer/languages/python/python-quickstart-fastapi/
This led to #8 and the ReadModel
and UpdateModel
creation.
Unfortunately, being dynamically generated, they are pretty useless for the static analyzers and the intellisense.
For this reason, it would be useful to generate stub files (I won't generate code in Python files, especially in existing ones, to keep generated code separate from manually written one).
https://mypy.readthedocs.io/en/stable/stubs.html
This is something that should be pretty simple to do automatically, starting with the stubgen
CLI.
The only thing I'm not sure about is whether I want to commit to the repo or not.
Contra: I don't like adding in Git and reviewing in GitHub generated files (even though they will look very close to the manually written ones)
Pro: they will be available in development as well.
dataclasses.replace
at DB level
For some collections, like package
, better to allow mutation.
Actually possible out of the box with Compass.
db.collection
)Like the QIBOPORT
or the CONTAINER
name.
platform qpu:iqm5q latest
id
s and most relevant information@scarrazza @stavros11 I'm now facing the problem of whom delegating the validation to.
I have essentially two ingredients, that generate two possible options:
command
passing a JSON schemaThe database has of course has to be there, but it only works with dictionaries (and at most TypedDict
for type hints). However, Pydantic gives me the objects, it should be able to turn the model specified by them into a JSON schema (which I would not need any longer), and it has a better integration with type checks.
On the one side, I wonder if I should keep insisting with Pydantic adoption, since I could do everything with MongoDB (giving up on type hints, and writing manually the JSON schema). On the other, I really want the objects, rather than dictionaries around, and Pydantic is a dependency actively developed, with >13k stars on GitHub... all in all it seems quite reliable.
So, the two tools are so complete that they span part of the things done by the other, and in particular validation is in both.
But they are also complementary, so I would just decide to whom attributing the intersection, and keep using both to have the full set of features.
If an element insertion fails, nothing should be written at all.
https://www.mongodb.com/docs/manual/core/transactions/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.