SQLAlchemyDB

SQLAlchemyDB: This module provides the BaseRSSDB class for providing standard DB interactions.

Uses sqlalchemy

class DIRAC.Core.Base.SQLAlchemyDB.SQLAlchemyDB(*args, **kwargs)

Bases: DIRACDB

Base class that defines some of the basic DB interactions.

__init__(*args, **kwargs)

c’tor

Parameters:

self – self reference

delete(table, params)
Parameters:
  • table (str) – table from where to delete

  • params (dict) – dictionary of which line(s) to delete

Returns:

S_OK() || S_ERROR()

getCSOption(optionName, defaultValue=None)
insert(table, params)

Inserts params in the DB.

Parameters:
  • table (str) – table where to insert

  • params (dict) – Dictionary to fill a single line

Returns:

S_OK() || S_ERROR()

select(table, params)

Uses params to build conditional SQL statement ( WHERE … ).

Parameters:
params - dict

arguments for the mysql query ( must match table columns ! ).

Returns:

S_OK() || S_ERROR()