MCPcopy Create free account
hub / github.com/NanGePlus/LightRAGTest / __init__

Method __init__

LightRAG/lightrag/kg/oracle_impl.py:21–55  ·  view source on GitHub ↗
(self, config, **kwargs)

Source from the content-addressed store, hash-verified

19
20class OracleDB:
21 def __init__(self, config, **kwargs):
22 self.host = config.get("host", None)
23 self.port = config.get("port", None)
24 self.user = config.get("user", None)
25 self.password = config.get("password", None)
26 self.dsn = config.get("dsn", None)
27 self.config_dir = config.get("config_dir", None)
28 self.wallet_location = config.get("wallet_location", None)
29 self.wallet_password = config.get("wallet_password", None)
30 self.workspace = config.get("workspace", None)
31 self.max = 12
32 self.increment = 1
33 logger.info(f"Using the label {self.workspace} for Oracle Graph as identifier")
34 if self.user is None or self.password is None:
35 raise ValueError("Missing database user or password in addon_params")
36
37 try:
38 oracledb.defaults.fetch_lobs = False
39
40 self.pool = oracledb.create_pool_async(
41 user=self.user,
42 password=self.password,
43 dsn=self.dsn,
44 config_dir=self.config_dir,
45 wallet_location=self.wallet_location,
46 wallet_password=self.wallet_password,
47 min=1,
48 max=self.max,
49 increment=self.increment,
50 )
51 logger.info(f"Connected to Oracle database at {self.dsn}")
52 except Exception as e:
53 logger.error(f"Failed to connect to Oracle database at {self.dsn}")
54 logger.error(f"Oracle database error: {e}")
55 raise
56
57 def numpy_converter_in(self, value):
58 """Convert numpy array to array.array"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected