Exemplo n.º 1
0
def EntityOntology():

    sys.stderr.write("EntityOntology sql_query.CgiPropertyQuery()=%s\n" %
                     str(sql_query.CgiPropertyQuery()))

    sys.stderr.write("EntityOntology survol_odbc.CgiPropertyDsn()=%s\n" %
                     str(survol_odbc.CgiPropertyDsn()))
    return ([sql_query.CgiPropertyQuery(), survol_odbc.CgiPropertyDsn()], )
Exemplo n.º 2
0
def MakeUri(dsnName, tableNam, columnNam):
    return lib_common.gUriGen.UriMakeFromDict(
        "odbc/column", {
            survol_odbc.CgiPropertyDsn(): dsnName,
            "Table": tableNam,
            "Column": columnNam
        })
Exemplo n.º 3
0
def GetDsnNameFromCgi(cgiEnv):
	keyWordDsn = survol_odbc.CgiPropertyDsn()
	dsnCoded = cgiEnv.m_entity_id_dict[keyWordDsn]
	dsnDecoded = keyWordDsn.ValueDecode(dsnCoded)

	# sys.stderr.write("GetDsnNameFromCgi dsnCoded=%s dsnDecoded=%s\n"%(dsnCoded,dsnDecoded))
	return dsnDecoded
Exemplo n.º 4
0
def DatabaseEnvParams(processId):
    # TODO: We could use the process id to check if the process executable is linked
    # with the SQLServer shareable library.

    # We do not list sources in lib_credentials because some ODBC sources
    # can be accessed without pass word (With Windows validation).
    sources = pyodbc.dataSources()
    # {
    # 	'MyNativeSqlServerDataSrc': 'SQL Server Native Client 11.0',
    # 	'Excel Files': 'Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)',
    # 	'SqlSrvNativeDataSource': 'SQL Server Native Client 11.0',
    # 	'mySqlServerDataSource': 'SQL Server',
    # 	'MyOracleDataSource': 'Oracle in XE',
    # 	'SysDataSourceSQLServer': 'SQL Server',
    # 	'dBASE Files': 'Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)',
    # 	'OraSysDataSrc' : 'Oracle in XE',
    # 	'MS Access Database': 'Microsoft Access Driver (*.mdb, *.accdb)'
    # }

    dsnList = ({survol_odbc.CgiPropertyDsn(): "DSN=" + dsn} for dsn in sources)

    # Maybe this must be adjusted as key-value pairs ??
    return ("sqlserver/query", dsnList)


# TODO: Add a link to https://sqlwebadmin.codeplex.com/ sqlwebadmin
Exemplo n.º 5
0
def DatabaseEnvParams(processId):

    dsnList = []
    aggregDsns = GetAggregDsns(int(processId))

    for aggregOffset in aggregDsns:
        # Do not take the character before the keyword.
        aggDSN = aggregDsns[aggregOffset]

        # TODO: Passwords are not crypted here, so decrypting will not work.

        dsnList.append({survol_odbc.CgiPropertyDsn(): aggDSN})

    # Should be odbc.
    return ("sqlserver/query", dsnList)
Exemplo n.º 6
0
def EntityName(entity_ids_arr):
    # sys.stderr.write("EntityName entity_ids_arr=%s\n"%str(entity_ids_arr))
    return survol_odbc.CgiPropertyDsn().ValueShortDisplay(
        entity_ids_arr[0]) + "::" + entity_ids_arr[1]
Exemplo n.º 7
0
def EntityOntology():
    return ([survol_odbc.CgiPropertyDsn(), "Procedure"], )
Exemplo n.º 8
0
def MakeUri(dsnName, procNam):
    return lib_common.gUriGen.UriMakeFromDict("odbc/procedure", {
        survol_odbc.CgiPropertyDsn(): dsnName,
        "Procedure": procNam
    })
Exemplo n.º 9
0
def MakeUri(dsnName):
	# sys.stderr.write("MakeUri dsnName=%s\n"%dsnName)
	return lib_common.gUriGen.UriMakeFromDict("odbc/dsn", { survol_odbc.CgiPropertyDsn() : dsnName })
Exemplo n.º 10
0
def EntityOntology():
	return ( [ survol_odbc.CgiPropertyDsn() ], )
Exemplo n.º 11
0
def EntityOntology():
    return ([survol_odbc.CgiPropertyDsn(), "Table", "Column"], )
Exemplo n.º 12
0
def MakeUri(dsnName):
    return lib_common.gUriGen.UriMakeFromDict(
        "sqlserver/dsn", {survol_odbc.CgiPropertyDsn(): dsnName})
Exemplo n.º 13
0
def EntityOntology():
    DEBUG("EntityOntology sql_query.CgiPropertyQuery()=%s",
          str(sql_query.CgiPropertyQuery()))
    DEBUG("EntityOntology survol_odbc.CgiPropertyDsn()=%s" %
          str(survol_odbc.CgiPropertyDsn()))
    return ([sql_query.CgiPropertyQuery(), survol_odbc.CgiPropertyDsn()], )