예제 #1
0
def get_mysqljoinTwo():
    db = mysql_database()

    def db_query():
        return db.joinTwo()

    res = db_query()
    return json_response(result=res)
예제 #2
0
def get_mysqlcount():
    db = mysql_database()

    def db_query():
        return db.count()

    res = db_query()
    return json_response(result=res)
예제 #3
0
def get_mysqldeleteMore():
    db = mysql_database()

    def db_query():
        return db.deleteMore()

    res = db_query()
    return json_response(result=res)
예제 #4
0
def get_mysqlupdateOne():
    db = mysql_database()

    def db_query():
        return db.updateOne()

    res = db_query()
    return json_response(result=res)
예제 #5
0
def get_mysqlfindAll():
    db = mysql_database()

    def db_query():
        return db.findAll()

    res = db_query()
    return json_response(result=res)
예제 #6
0
def insert_events(events):
    logging.info('Inserting events in database...')
    database = mysql_database()
    for event in events:
        if (event.description != None and event.source != None
                and event.date != None):
            insert_event_query = ('INSERT INTO events '
                                  '(name, description, url, source, date) '
                                  'VALUES (%s, %s, %s, %s, %s)')
            database.query(insert_event_query,
                           (event.name, event.description, event.url,
                            event.source, event.date))
        else:
            logging.warn(
                "Missing required event property, can't insert event in database: "
                + event.__str__())
    database.cnx.commit()
예제 #7
0
def get_mysql_db():
	return mysql_database(mysql_database_conf())
예제 #8
0
파일: __init__.py 프로젝트: bingsec/libjade
		
	

	db=get_sqlite_db()
	print db
	
	db=get_mysql_db()
	print db
	
	db=get_pooled_mysql_db()
	print db
	
	db_conf=mysql_database_conf()
	pool_conf=database_pooling_conf()
	
	db1=mysql_database(db_conf)
	db=mysql_database(db_conf)
	for i in xrange(1):
		# if i%100==0: print i
		print db.conf
		print db.conn
		print db.addslashes('''a'b&p"m/ss''')
		print db.get_cursor()
		print db.conn
		
		print len(db.table('db'))
		print len(db.table_dict('db'))
		print db.one('select db from db')
		print db.first('select db from db')
		print db.one_dict('select db from db')
		print len(db.all('select * from db'))
예제 #9
0
 def __init__(self):
     self.poloniex_conn = poloniex_functions()
     self.mysql_conn = mysql_database(self)
     self.ifttt_conn = ifttt()