From 7970b8787eb78b2a8b1ab54cc65ae22d469f40c7 Mon Sep 17 00:00:00 2001 From: RUN Date: Fri, 23 Jan 2026 18:04:54 +0100 Subject: [PATCH] feat: update Oracle documentation, add integration tests, and improve code comments --- docs/en/reference/prebuilt-tools.md | 14 +++++++------- internal/sources/oracle/oracle.go | 15 ++++++++++++++- tests/oracle/oracle_integration_test.go | 18 +++++++++++++++--- .../sources => tests}/oracle/oracle_test.go | 14 +++++++++++++- 4 files changed, 49 insertions(+), 12 deletions(-) rename {internal/sources => tests}/oracle/oracle_test.go (91%) diff --git a/docs/en/reference/prebuilt-tools.md b/docs/en/reference/prebuilt-tools.md index 859ee768a0..54792a3547 100644 --- a/docs/en/reference/prebuilt-tools.md +++ b/docs/en/reference/prebuilt-tools.md @@ -689,7 +689,9 @@ See [Usage Examples](../reference/cli.md#examples). * **Permissions:** * **Database-level permissions** are required to execute Cypher queries. * **Tools:** - + * `execute_cypher`: Executes a Cypher query. + * `get_schema`: Retrieves the schema of the Neo4j database. + ## Oracle @@ -698,14 +700,12 @@ See [Usage Examples](../reference/cli.md#examples). * `ORACLE_HOST`: The hostname or IP address of the Oracle server. * `ORACLE_PORT`: The port number for the Oracle server (Default: 1521). * `ORACLE_CONNECTION_STRING`: The - * `ORACLE_USER`: The - * `ORACLE_PASSWORD`: The + * `ORACLE_USER`: The username for the Oracle DB instance. + * `ORACLE_PASSWORD`: The password for the Oracle DB instance * `ORACLE_WALLET`: The path to Oracle DB Wallet file for the databases that support this authentication type - * `ORACLE_USE_OCI`: true or false, The flag if the Oracle Database is deployed in cloud deployment - + * `ORACLE_USE_OCI`: true or false, The flag if the Oracle Database is deployed in cloud deployment. Default is false. * **Permissions:** - * Database-level permissions (e.g., `SELECT`, `INSERT`) are required to - execute queries. + * Database-level permissions (e.g., `SELECT`, `INSERT`) are required to execute queries. * **Tools:** * `execute_sql`: Executes a SQL query. * `list_tables`: Lists tables in the database. diff --git a/internal/sources/oracle/oracle.go b/internal/sources/oracle/oracle.go index f9202323ce..5082b00b71 100644 --- a/internal/sources/oracle/oracle.go +++ b/internal/sources/oracle/oracle.go @@ -1,4 +1,17 @@ -// Copyright © 2025, Oracle and/or its affiliates. +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package oracle import ( diff --git a/tests/oracle/oracle_integration_test.go b/tests/oracle/oracle_integration_test.go index 0347e47788..aad4ce594a 100644 --- a/tests/oracle/oracle_integration_test.go +++ b/tests/oracle/oracle_integration_test.go @@ -1,4 +1,16 @@ -// Copyright © 2025, Oracle and/or its affiliates. +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package oracle @@ -163,7 +175,7 @@ func TestOracleConnectionPureGoWithWallet(t *testing.T) { "", // tnsAlias "", // tnsAdmin "/tmp/nonexistent_wallet", // walletLocation - false, // useOCI + oracleUseOCI, // useOCI ) defer cleanup() @@ -337,7 +349,7 @@ func getOracleAuthToolInfo(t *testing.T, tableName string) (string, string, stri toolStatement := fmt.Sprintf(`SELECT "name" FROM %s WHERE "email" = :1`, tableName) - params := []any{"Alice", tests.GetTestServiceAccountEmail(t), "Jane", "janedoe@gmail.com"} + params := []any{"Alice", tests.ServiceAccountEmail, "Jane", "janedoe@gmail.com"} return createStatement, insertStatement, toolStatement, params } diff --git a/internal/sources/oracle/oracle_test.go b/tests/oracle/oracle_test.go similarity index 91% rename from internal/sources/oracle/oracle_test.go rename to tests/oracle/oracle_test.go index 85e50fceeb..b66668d494 100644 --- a/internal/sources/oracle/oracle_test.go +++ b/tests/oracle/oracle_test.go @@ -1,4 +1,16 @@ -// Copyright © 2025, Oracle and/or its affiliates. +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package oracle_test