Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    sqlpuzzle 0.19.1

    Download button

    No screenshots available
    Downloads: 167  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Michal Horejsek | More programs
    GPL / FREE
    September 12th, 2012, 11:52 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    sqlpuzzle description

    Python library for ease of writing SQL queries

    sqlpuzzle is a Python library for ease of writing SQL queries.

    Examples:

    >>> import sqlPuzzle

    >>> print sqlPuzzle.selectFrom('table')
    SELECT * FROM `table`

    >>> print sqlPuzzle.select('id', ('user_name', 'userName')).from_('table')
    SELECT `id`, `user_name` AS "userName" FROM `table`

    >>> print sqlPuzzle.selectFrom('table').\
    ... where(name='Alan').\
    ... where('age', 20, sqlPuzzle.relations.LE).\
    ... where({'sex': 'male'}).\
    ... where(
    ... ('column', 'value', sqlPuzzle.relations.LIKE),
    ... ('id', range(5,15,2))
    ... )
    SELECT * FROM `table` WHERE `name` = "Alan" AND `age` >> print sqlPuzzle.selectFrom('table').limit(5, 20)
    SELECT * FROM `table` LIMIT 5 OFFSET 20

    >>> print sqlPuzzle.insertInto('table').values(name='Michael', age=20)
    INSERT INTO `table` (`age`, `name`) VALUES (20, "Michael")

    >>> print sqlPuzzle.update('table').set(name='Michale').where(id=42)
    UPDATE `table` SET `name` = "Michale" WHERE `id` = 42

    >>> print sqlPuzzle.update('table').set(name='Michale')
    Traceback (most recent call last):
     ...
    ConfirmUpdateAllException: Are you sure, that you want update all records?

    >>> print sqlPuzzle.deleteFrom('table').where(id=42)
    DELETE FROM `table` WHERE `id` = 42

    >>> print sqlPuzzle.deleteFrom('table')
    Traceback (most recent call last):
     ...
    ConfirmDeleteAllException: Are you sure, that you want delete all records?



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    SQL queries | Python library | Python | SQL | queries

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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