Package: vdk-oracle
oracleSupport for VDK Managed Oracle connectionTODO: what the project is about, what is its purposeUsagepip install vdk-oracleConfiguration(vdk config-helpis useful command to browse all config options of your installation of vdk)NameDescription(example)  Valueoracle_userUsername used when connecting to Oracle databasemy_useroracle_passwordPassword used when connecting to Oracle databasesuper_secret_shhhhoracle_use_secretsSet to True to use secrets to connect to OracleTrueoracle_connection_stringThe Oracle connection stringlocalhost:1521/freeoracle_hostThe host of the Oracle database. Note: This gets overridden if oracle_connection_string is set.localhostoracle_portThe port of the Oracle database. Note: This gets overridden if oracle_connection_string is set.1521oracle_sidThe SID of the Oracle database. Note: This gets overridden if oracle_connection_string is set.freeoracle_service_nameThe Service name of the Oracle database. Note: This gets overridden if oracle_connection_string is set.freeoracle_thick_modePython-oracledb is said to be in Thick mode when Oracle Client libraries are used. True by default. Set to False to disable Oracle Thick mode. More info:https://python-oracledb.readthedocs.io/en/latest/user_guide/appendix_b.htmlTrueExampleCLI QueriesexportVDK_ORACLE_USER=my_usernameexportVDK_ORACLE_PASSWORD=my_passwordexportVDK_ORACLE_CONNECTION_STRING=localhost:1521/free
vdkoracle-query-q"SELECT * FROM TEST_TABLE"Note:Running CLI queries does not support secretsIngestionimportdatetimefromdecimalimportDecimaldefrun(job_input):# Ingest objectpayload_with_types={"id":5,"str_data":"string","int_data":12,"float_data":1.2,"bool_data":True,"timestamp_data":datetime.datetime.fromtimestamp(1700554373),"decimal_data":Decimal(0.1),}job_input.send_object_for_ingestion(payload=payload_with_types,destination_table="test_table")# Ingest tabular datacol_names=["id","str_data","int_data","float_data","bool_data","timestamp_data","decimal_data",]row_data=[[0,"string",12,1.2,True,datetime.datetime.fromtimestamp(1700554373),Decimal(1.1),],[1,"string",12,1.2,True,datetime.datetime.fromtimestamp(1700554373),Decimal(1.1),],[2,"string",12,1.2,True,datetime.datetime.fromtimestamp(1700554373),Decimal(1.1),],]job_input.send_tabular_data_for_ingestion(rows=row_data,column_names=col_names,destination_table="test_table")Ingestion with type inferenceIngestion works with an already created table even if you pass strings in the
payload.vdk-oracleinfers the correct type based on the existing table.createtabletest_table(idnumber,str_datavarchar2(255),int_datanumber,float_datafloat,bool_datanumber(1),timestamp_datatimestamp,decimal_datadecimal(14,8),primarykey(id))defrun(job_input):payload={"id":"5","str_data":"string","int_data":"12","float_data":"1.2","bool_data":"False","timestamp_data":"2023-11-21T08:12:53","decimal_data":"0.1",}job_input.send_object_for_ingestion(payload=payload,destination_table="test_table")Build and testingpip install -r requirements.txt
pip install -e .
pytestIn VDK repo../build-plugin.shscript can be used also.Note about the CICD:.plugin-ci.yaml is needed only for plugins part ofVersatile Data Kit Plugin repo.The CI/CD is separated in two stages, a build stage and a release stage.
The build stage is made up of a few jobs, all which inherit from the same
job configuration and only differ in the Python version they use (3.7, 3.8, 3.9 and 3.10).
They run according to rules, which are ordered in a way such that changes to a
plugin's directory trigger the plugin CI, but changes to a different plugin does not.