Apache CouchDB

Apache CouchDB™ lets you access your data where you need it by defining the Couch Replication Protocol that is implemented by a variety of projects and products that span every imaginable computing environment from globally distributed server-clusters, over mobile phones to web browsers. Software that is compatible with the Couch Replication Protocol include: PouchDB, Cloudant, and Couchbase Lite.



AdonisJs is a true MVC Framework for Node Js. It encapsulate all the boring parts of Web programming and offers you a nice & clean API to work with.



  • Routing

    AdonisJs has one of the most advanced routing engine with support of groups, named routes, subdomains, and controller bindings.

  • Ace Commands

    Ace is a fully baked command line tool shipped with Adonis. Not only you can make use of available commands, creating your own commands is just a matter of seconds.

  • Authentication System

    Inbuilt authentication layer to keep your applications secure with Sessions, JWT, Basic Auth and Personal API tokens.

  • ES2015 Controllers

    AdonisJs makes use of ES2015 features. You define your controllers as Classes and controller methods makes use of ES2015 generators

  • Emailer

    Sending emails is so simple and intutive with inbuilt drivers like Mailgun, Mandrill, SMTP and Amazon SES

  • Data Validator

    Validating data should be simple and fun. AdonisJs handmade validator makes it so simple to validate nested data with expressive set of rules.

  • Security Features

    All AdonisJs applications are pre-configured to handle CSRF, CORS, XSS and other Web attacks out of the box.

  • SQL Orm

    AdonisJs ORM ( Lucid ) is an implementation of Active Record. Leave your traditional SQL queries behind and make use of shiny data models.

  • Event Emitter

How to retrieve the ID after a MySQL Insert in Python-pymysql

When you have an auto_increment field on a table, and you’re doing a batch import of new data, you often want to insert a row, then insert more rows that have a foreign key referencing the first row. For example, you want to insert a COMPANY entity, then insert a few dozen PERSON entities under that company. Assuming you have no unique and not-null fields on the COMPANY entity (if company_name were unique and not-null, then you could just issue a select immediately after inserting to get its ID), and assuming you want a thread-safe solution (you could just select for the highest ID in the table immediately after inserting, but since MySQL is by default not transaction-safe, another thread could come in and insert another company right after you insert and before your select), you simply need to have mysql_insert_id().

The MySQLdb documentation mentions conn.insert_id(), however this appears to have been deprecated, maybe? This really should be on the cursor object anyway. And behold! There is a lastrowid on it! It’s just a little bit undocumented:

We are using here pymysql client library:

import pymysql

conn = pymysql.connect(
c = conn.cursor()

name='john doe'

dept='information technology'

query="INSERT INTO student(name,dept) VALUES(%s,%s)"
print c.lastrowid  #will print last insert mysql auto_increment id