Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Database > Database APIs

    dse 3.3.0

    Download button

    No screenshots available
    Downloads: 443  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Thomas Weholt | More programs
    BSD License / FREE
    June 12th, 2012, 21:56 GMT [view history]
    ROOT / Database / Database APIs

     Read user reviews (0)  Refer to a friend  Subscribe

    dse description

    Delayed SQL Executor

    dse is a simple and crude way of not executing SQL queries in sequence, but caching values until a given max value has been met and then execute them using the executemany-method. The result can be huge speed gains.

    dse was only tested on SQLite3 but intended for use in django as well.

    Example usage:

    import sqlite3 # for testing purposes

    from dse import DelayedSqlExecutor

    conn = sqlite3.connect(':memory:')
    cursor = conn.cursor()
    cursor.execute('create table filedata (id INTEGER PRIMARY KEY, filepath TEXT, filename TEXT, filesize INTEGER)')
    d = DelayedSqlExecutor(cursor, paramtoken= '?') # using the ? paramtoken here for sqlite3. Leave it blank and it`ll use %s as support by Django etc.
    d.addObject('filedata', ('id', 'filepath', 'filename', 'filesize'))

    for i in range(0, 999):
        # adding some dummy data. Notice the absence of the id-field. This will trigger inserts.
        #Adding the id-field would trigger an update for data not yet in the db
        d.addItem('filedata', {'filepath': '/tmp/', 'filename': 'test%s.txt' % i, 'filesize': i})
    # No SQL has been executed yet, the default limit is 1000 items

    # Adding another item will trigger the execution of SQLs and reset the d-instance
    d.addItem('filedata', {'filepath': '/tmp/', 'filename': 'test%s.txt' % i, 'filesize': i})

    # Adding some records to update
    d.addItem('filedata', {'id': 1, 'filepath': '/tmp/', 'filename': 'testmore%s.txt' % i, 'filesize': 100})

    # calling close will execute any remaining SQLs
    d.close()

    # you might be required to call commit on the cursor to commit the data. Depends on how you set up the cursor/connection.



    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · Backwards compatibility with django 1.3.x. Thanks to John Spray for this one.

      


    TAGS:

    SQL queries | SQL executor | SQL | queries | executor

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM