ZODB | Python object-oriented database | Database library
kandi X-RAY | ZODB Summary
kandi X-RAY | ZODB Summary
Python object-oriented database
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Return the persistent id of an object .
- Read an index .
- Parse command line arguments .
- Perform a transaction .
- Shift the transactions forward by position .
- Imports imports from a file .
- Find a module by name .
- Recover old files .
- Perform a full backup .
- Copies data records from a single record .
ZODB Key Features
ZODB Examples and Code Snippets
Community Discussions
Trending Discussions on ZODB
QUESTION
I have a Plone 5.0.5 deployment and the need the package zc.zrs for ZODB replication. After adding the information to the buildout.cfg, I've added the URL https://pypi.org/simple on the index parameter:
...ANSWER
Answered 2022-Feb-27 at 11:26The Plone buildout should be able to download from pypi by default. Check if you can download with wget into your download folder:
You should have a downloads folder in your buildout-cache folder, if you are using the default installer. I do that sometimes when the server has some strange network configurations and can't download some packages directly.
QUESTION
I am currently writing a Python desktop app that performs some basic data analysis and data display. The data comes from some experiments in our research lab, and we are storing the data in a ZODB database using a FileStorage.
The code to open the database is fairly straightforward, and looks like what you would expect:
...ANSWER
Answered 2021-Jun-08 at 15:08zstorage = ZODB.FileStorage.FileStorage('testz.fs') # testz.fs has been created with ZlibStorage
try:
db = ZODB.DB(zstorage)
except:
zstorage.close()
zstorage = zc.zlibstorage.ZlibStorage(ZODB.FileStorage.FileStorage('testz.fs'))
db = ZODB.DB(zstorage)
QUESTION
I am trying to save a blob > 1GB via relstorage in a sqlite backend. The following minimum working example
- removes any previously created databases along with the blob directory,
- create a new database and
- saves a blob with 1GB to the database.
Minimum Working Example:
...ANSWER
Answered 2020-Oct-19 at 12:00According to my research, you can't store arbitrary sized blobs in this setup. You are hitting the sqlite blob size limit (https://www.sqlite.org/limits.html).
Your only options at this stage appear to be:
- Don't store the blob in sqlite, e.g. by using a shared blob directory.
- Increase the blob limit, using a custom build of sqlite (as covered in the above link).
- Decrease the size of what you store - e.g. by compressing your blobs, or chunking your data into smaller blobs.
- Move to a different storage backend.
Personally, I would be inclined to use the shared blob directory if I was using sqlite, but you have discounted that option, so I think you're choices are limited.
QUESTION
This question is related to How to pack blobstorage with Plone and RelStorage
Using zodb database with RelStorage and sqlite as its backend I am trying to remove unused blobs. Currently db.pack does not remove the blobs from disc. The minimum working example below demonstrates this behavior:
...ANSWER
Answered 2020-Sep-01 at 00:34By default, the blob storage directory is used as a cache, storing blob data that also is stored in the database; the idea is that loading blob data from a local disk cache is faster than from a remote database server. Packing in a history-free storage with caching blob storage doesn’t delete unreachable blob files, instead relying on the file size limiter to evict stale cache data when room needs to be made. However, you did not set a size limit, so the cache grows unbounded and those unreachable blob files will live on forever.
Packing can’t remove blob files here because the cache is local to each ZODB client; it is outside the jurisdiction of the ZODB storage, as it were. This may not be as apparent when using SQLite as the database layer but imagine using Postgres instead, on a separate server, with multiple clients across different computers and you can see that cache clean-up is not feasible when packing.
Note that the other blob storage option is the shared blob storage, which is probably closer to what you expected this to be: all blob data is stored on disk, not in the database. When used with a remote database server and multiple clients you’d need to place this on something like a NTFS share. Packing operates directly on the blobs in that case and unreachable blob files are removed immediately when you pack.
You have two options:
Set a size limit for the blob cache by setting
blob-cache-size
. Packing still won’t remove the blob files, but they will be removed when space is running low.Switch to a shared blob cache (set
shared-blob-dir
to true). For a sqlite-backed RelStorage this probably makes more sense than a caching blob storage, in spite of the dire warnings in the documentation!
So the easiest change would be to switch blob storage modes:
QUESTION
I am working on a project with ZODB database, and have the following problem:
...ANSWER
Answered 2020-Aug-17 at 23:46Consider using a while
loop instead:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
Install ZODB
You can use ZODB like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page