473,396 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to pickle objects for database storage?

hello,
I have a strange but very interesting requirement?
provided that a database can provide for an object data type like
binary large object (blob), can I store a pickeled python object in
it?
I know oracle has blob and clob and believe that mysql/ postgre sql
has some thing similar to store direct objects?
if not then should a pickeled object wrapped inside a file and then
stored in a database?
regards.
Krishnakant.
Apr 11 '07 #1
1 1571
krishnakant Mane a écrit :
hello,
I have a strange but very interesting requirement?
provided that a database can provide for an object data type like
binary large object (blob), can I store a pickeled python object in
it?
Certainly, but that's one of the dumbest things to do IMHO. If you use a
relational DBMS, you'd better use it properly (FWIW, there's a pretty
good Python abstraction layer/ORM named SQLAlchemy). And if you don't
want a RDBMS, then there are good Python OODBMS (Zope and Durus to name
the most famous ones).

My 2 cents...
Apr 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kris Caselden | last post by:
Python's docs say that Shelve uses Pickle to serialize its data. However, I've noticed that Pickle can maintain internal links, while Shelve cannot. For instance: >>> d =...
9
by: Larry goodman | last post by:
Hi, Im an old C++ salt who is doing his first large project using python/wxPython. Fantastically productive are python and wxWindows. If you could bear with me, I have a couple of questions for...
0
by: Jean-Luc | last post by:
Hi I am grafing pickling functionality on a big dictionary of object instances and I am having numerous problems. I think understand the notion of what can/can't be pickled and I know how to...
2
by: GMane Python | last post by:
Hey all. I have a ( list | tuple | dictionary ) with several graphics in it. Trying to cPickle it to a file, I get errors. For instance, UnpickleableError: Cannon pickle <type 'ImagingCore'>...
2
by: DurumDara | last post by:
Hi ! I want to create a database from datas. I want to store my datas in lists/dicts/normal variables. I thinking about that I can use the pickle to serialize/load my datas from the file. ...
6
by: Jim Lewis | last post by:
Pickling an instance of a class, gives "can't pickle instancemethod objects". What does this mean? How do I find the class method creating the problem?
10
by: crystalattice | last post by:
I'm creating an RPG for experience and practice. I've finished a character creation module and I'm trying to figure out how to get the file I/O to work. I've read through the python newsgroup...
3
by: fizilla | last post by:
Hello all! I have the following weird problem and since I am new to Python I somehow cannot figure out an elegant solution. The problem reduces to the following question: How to pickle a...
2
by: Michele Simionato | last post by:
Can somebody explain what's happening with the following script? $ echo example.py import pickle class Example(object): def __init__(self, obj, registry): self._obj = obj self._registry =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.