-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix baseline implementation, add simple experiment script
- Loading branch information
Showing
2 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import argparse | ||
|
||
from brad.config.engine import Engine | ||
from brad.config.file import ConfigFile | ||
from brad.connection.connection import Connection | ||
from brad.connection.factory import ConnectionFactory | ||
from brad.connection.odbc_connection import OdbcConnection | ||
|
||
|
||
def main() -> None: | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--address", type=str, required=True) | ||
parser.add_argument("--port", type=str, required=True) | ||
parser.add_argument("--physical-config-file", type=str, required=True) | ||
args = parser.parse_args() | ||
|
||
config = ConfigFile.load_from_physical_config(args.physical_config_file) | ||
cstr = ConnectionFactory._pg_aurora_odbc_connection_string( | ||
args.address, | ||
args.port, | ||
config.get_connection_details(Engine.Aurora), | ||
schema_name=None, | ||
) | ||
cxn: Connection = OdbcConnection.connect_sync(cstr, autocommit=True, timeout_s=30) | ||
cursor = cxn.cursor_sync() | ||
cursor.execute_sync("SELECT 1") | ||
print(cursor.fetchall_sync()) | ||
|
||
cxn.close_sync() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |