This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # vector-query.py | |
| # | |
| # Run this after running vector-insert.py, https://gist.github.com/cjbj/ee7152b223928b5b7a5959fe87fa2ab3 | |
| # | |
| # For other python-oracledb DataFrame examples, see https://github.com/oracle/python-oracledb/tree/main/samples | |
| # Related blog: https://medium.com/oracledevs/the-best-way-to-fetch-and-insert-python-dataframes-and-tensors-with-oracle-database-70a1b24a3d99 | |
| # Documentation: https://python-oracledb.readthedocs.io/en/latest/user_guide/dataframes.html | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # vector-insert.py | |
| # | |
| # For other python-oracledb DataFrame examples, see https://github.com/oracle/python-oracledb/tree/main/samples | |
| # Related blog: https://medium.com/oracledevs/the-best-way-to-fetch-and-insert-python-dataframes-and-tensors-with-oracle-database-70a1b24a3d99 | |
| # Documentation: https://python-oracledb.readthedocs.io/en/latest/user_guide/dataframes.html | |
| import os | |
| import pandas | |
| import oracledb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # insert.py | |
| # | |
| # For other python-oracledb DataFrame examples, see https://github.com/oracle/python-oracledb/tree/main/samples | |
| import os | |
| import pandas | |
| import oracledb | |
| un = os.environ.get('ORACLE_USERNAME') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # deltalake-write.py | |
| # | |
| # For other python-oracledb DataFrame examples, see https://github.com/oracle/python-oracledb/tree/main/samples | |
| import os | |
| import oracledb | |
| import pyarrow | |
| from deltalake import DeltaTable, write_deltalake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pandas-new.py | |
| # | |
| # For other python-oracledb DataFrame examples, see https://github.com/oracle/python-oracledb/tree/main/samples | |
| import os | |
| import pyarrow | |
| import oracledb | |
| un = os.environ.get('ORACLE_USERNAME') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # parallelselect.py | |
| # | |
| # [email protected], Feb 2023 | |
| # | |
| # This may or may not be faster than a single thread statement that | |
| # reads the whole table. | |
| # | |
| import csv | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import getpass | |
| import os | |
| import traceback | |
| import oracledb | |
| un = '' | |
| cs = '' | |
| pw = getpass.getpass(f'Enter password for {un}: ') | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/sh -x | |
| # | |
| # This is my old script for auto-starting Oracle DB on Linux. | |
| # When I'm not using Cloud Databases, I now install the Oracle Database 21c RPM which includes its own script | |
| # | |
| # chkconfig: 2345 80 05 | |
| # description: start and stop Oracle Databases | |
| # | |
| # OL7: systemctl enable dbora |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/queryStream.js b/lib/queryStream.js | |
| index 08ddc72..09efc99 100644 | |
| --- a/lib/queryStream.js | |
| +++ b/lib/queryStream.js | |
| @@ -89,11 +89,6 @@ class QueryStream extends Readable { | |
| this._fetching = true; | |
| this._resultSet._allowGetRowCall = true; | |
| const row = await this._resultSet.getRow(); | |
| - this._fetching = false; | |
| - if (!this._resultSet) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const oracledb = require('oracledb'); | |
| const dbConfig = require('./dbconfig.js'); | |
| if (process.platform === 'darwin') { | |
| oracledb.initOracleClient({libDir: process.env.HOME + '/Downloads/instantclient_19_8'}); | |
| } | |
| let result; | |
| async function run() { |
NewerOlder