16 lines
376 B
Python
16 lines
376 B
Python
|
from pythontest.DatabaseConnection import DatabaseConnection
|
||
|
|
||
|
|
||
|
class SimpleConnection(DatabaseConnection):
|
||
|
def __init__(self, config):
|
||
|
self.user = config['user']
|
||
|
|
||
|
def query(self, stmt: str):
|
||
|
typ, ids = stmt.split(':', 1)
|
||
|
ids = ids.split(',')
|
||
|
|
||
|
name = '%s %s for %s'
|
||
|
result = [ { 'id': int(id), 'name': name % (typ, id, self.user) } for id in ids ]
|
||
|
return result
|
||
|
|