Python Database: The Work Continues

28 Aug 2008 21:36

Today more work was done by me on the object oriented database implemented in Python.

I dealt with some problems I came across like proper object encapsulation. Now, my database allows any object to be stored in it, even of classes that are internally used by my database.

I implemented "." and "WHERE" operators, which seemed the worst, because they needed working environmental stack.

Now comes, what's the most individual — optimizing things with query cache. Actually it's not a query cache, but rather a evaluateNode cache, but this works very similar (the only difference is that the evaluateNode cache is more deep in operation and can be used inside of queries. This means it can accelerate the processing even for one query!

More work will come for sure on this, because the cache seems to be really tricky with such a flexible database model we've assumed.

Keep tuned for more news

Comments: 1

SQL King

21 Aug 2008 10:00

Are you an SQL King?

I once met a person that used to write SQL queries more sophisticated than this:

select *
    from category
    where category_id IN
        (select cat1 as category_id
            from (select min(category_id) as cat1, max(category_id) as cat2, name, site_id, count(*)
                from category
                group by name, site_id
                having count(*) > 1
            ) as c1
        union    select cat2 as category_id
            from (select min(category_id) as cat1, max(category_id) as cat2, name, site_id, count(*)
                from category
                group by name, site_id
                having count(*) > 1
            ) as c2

This one is to check duplicated categories in sites from Wikidot. It's not optimal, but it works. Of course the situation when there exist duplicated categories is a bug, but it seems a really rare one, because from the beginning of Wikidot, there are only 20 such categories, all of them being forum, so this probably means a small bug in create a forum thing as well.

Comments: 2


16 Aug 2008 16:30

Wonder why blog on Wikidot, not on Wordpress?

With Wikidot, you can give your badges a reflection:


(this one was created with Cooltext)

Welcome on Wikidot. Where dreams come true.

How to do this

Put somewhere on your wiki:

[[image class="reflect"]]
<script type="text/javascript" src=""></script>

Comments: 1

Object Database In Python - Day 2

16 Aug 2008 16:12

Hello again,

as pointed in the previous day comment, there is another IDE for developing in Python, which is BoaConstructor. As a matter of fact, I haven't taken that into consideration, because it was told it is a IDE for GUI development. As I was not about creating a GUI, this was completely skipped.

My impressions of the IDEs:

  • pida, geany, drpython — interesting, but not worth a try for me
  • eric — good overall, but raises many dialog boxes with information of exceptions. These are fatal and are about the GUI, so you have to click OK and continue working

I tried the Eric first, because it was written as a really good program. I like it, but it is not polished and would never be bought (if commercial) by anyone:

  • the support for SVN is really tricky
  • the GUI is really not intuitive — no "delete a file" or "new file (here)" in the navigator context menu
  • the code completion is there, but not really so clever

for example, having the following code:

class aClass:
    def method(self, param):
        assert isinstance(param, list)

the IDE should know, that the param is a list and complete the list methods! I believe the PyDev plugin for Eclipse already did it when I last used it.

After trying all the listed IDEs I got back to Eric as one of two best Python IDEs tried by me (the second is PyDev).

Happy Pythoning
Your Piotr

Comments: 1

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License