dataBase - API

How to implement a new dataBase

tba.

API

class pipeLionServer.dataBaseAPI.abstractDataBase.AbstractDataBase[source]

Class holds functionality to make databaseRequests by calling services. to implement this abstract Class to an external database there are four instance-methods, which have to be reimplemented:

1. connectToDataBase()
2. createCursor()
3. saveDB()
4. makeRequest(request, kwargs, save=False)
connectToDataBase()[source]

method to connect to a dataBase

createCursor()[source]

method to create a cursor

loadServices()[source]

method iters through each service module found in pipeLionServer.service and creates instances of each Service-class and put them into a dictionary of class-types and insrances

makeRequest(request, kwargs, save=False)[source]

method to make a request

Parameters:
  • request (string) – request should be a SQL-command
  • saveDB (bool) – should define if the request should be saved to tha database or not.
Returns:

return-value of the dataBase request.

Return type:

variant object

parseRequest(request)[source]

the parseRequest method is called by the Server to gather the right ServiceModule. If the given service-module is not found, a PipeLionServerException is returned. If it is found the request will be send to this Service and the result will be returned

saveDB()[source]

method to save a db entry

implementations

SqLiteDataBase

class pipeLionServer.dataBaseAPI.sqLiteDataBase.SqLiteDataBase[source]

This class is the implementation of the sqLite3 dataBase into the pipeLionServer

connectToDataBase()[source]

method to connect to a dataBase

createCursor()[source]

method to create a cursor

loadServices()

method iters through each service module found in pipeLionServer.service and creates instances of each Service-class and put them into a dictionary of class-types and insrances

makeRequest(request, save=False)[source]

method to make a request

Parameters:
  • request (string) – request should be a SQL-command
  • saveDB (bool) – should define if the request should be saved to tha database or not.
Returns:

return-value of the dataBase request.

Return type:

variant object

parseRequest(request)

the parseRequest method is called by the Server to gather the right ServiceModule. If the given service-module is not found, a PipeLionServerException is returned. If it is found the request will be send to this Service and the result will be returned

saveDB()[source]

method to save a db entry

Table Of Contents

Previous topic

core classes

Next topic

services

This Page