#!/usr/bin/env python
# Copyright (c) TripleBlind Holdings, Inc. Confidential and Proprietary. All rights reserved.

import tripleblind as tb


raise SystemExit("This script is for reference only.")

tb.initialize()

#############################################################################
# Oracle DBMS is a relational database developed by Oracle Corporation.
# TripleBlind data assets can be created on top of this database by defining a
# view of the data using an SQL Query.  Beyond the view, you also need to
# define the route to the database as well as proper credentials to access
# the data.
#
# The values below define a data asset that is linked to an Oracle database.

# Address of your Oracle database
SERVER = "test-oracle.database.net"

# The default port for Oracle is 1521
PORT = 1521

# The specific database name within Oracle
DATABASE_NAME = "SampleDatabase"

# SQL statement which generates the view of data you want to connect as an
# asset.  This can be simple or complex with conditions and calculated fields.
SQL_VIEW = "SELECT CustomerID, FirstName, LastName, Phone FROM SalesLT.Customer;"

#############################################################################

asset1 = tb.asset.OracleDatabase.create(
    host=SERVER,
    port=PORT,
    database=DATABASE_NAME,
    username="dbuser1",
    password="dbpassword1",
    query=SQL_VIEW,
    name="Oracle Demo DB",
    desc="Oracle Database Asset",
    is_discoverable=True,
)
