Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/js/generated/ts/oracle.ts
2846 views
1
2
3
/**
4
* IsOracleResponse is the response from the IsOracle function.
5
* this is returned by IsOracle function.
6
* @example
7
* ```javascript
8
* const oracle = require('nuclei/oracle');
9
* const client = new oracle.OracleClient();
10
* const isOracle = client.IsOracle('acme.com', 1521);
11
* ```
12
*/
13
export interface IsOracleResponse {
14
IsOracle?: boolean,
15
Banner?: string,
16
}
17
18
/**
19
* Client is a client for Oracle database.
20
* Internally client uses go-ora driver.
21
* @example
22
* ```javascript
23
* const oracle = require('nuclei/oracle');
24
* const client = new oracle.OracleClient();
25
* ```
26
*/
27
export class OracleClient {
28
// Constructor of OracleClient
29
constructor() {}
30
31
/**
32
* Connect connects to an Oracle database
33
* @example
34
* ```javascript
35
* const oracle = require('nuclei/oracle');
36
* const client = new oracle.OracleClient();
37
* client.Connect('acme.com', 1521, 'XE', 'user', 'password');
38
* ```
39
*/
40
public Connect(host: string, port: number, serviceName: string, username: string, password: string): boolean | null {
41
return null;
42
}
43
44
/**
45
* ConnectWithDSN connects to an Oracle database using a DSN string
46
* @example
47
* ```javascript
48
* const oracle = require('nuclei/oracle');
49
* const client = new oracle.OracleClient();
50
* client.ConnectWithDSN('oracle://user:password@host:port/service', 'SELECT @@version');
51
* ```
52
*/
53
public ConnectWithDSN(dsn: string): boolean | null {
54
return null;
55
}
56
57
/**
58
* IsOracle checks if a host is running an Oracle server
59
* @example
60
* ```javascript
61
* const oracle = require('nuclei/oracle');
62
* const isOracle = oracle.IsOracle('acme.com', 1521);
63
* ```
64
*/
65
public IsOracle(host: string, port: number): IsOracleResponse | null {
66
return null;
67
}
68
69
/**
70
* ExecuteQuery connects to Oracle database using given credentials and executes a query.
71
* It returns the results of the query or an error if something goes wrong.
72
* @example
73
* ```javascript
74
* const oracle = require('nuclei/oracle');
75
* const client = new oracle.OracleClient();
76
* const result = client.ExecuteQuery('acme.com', 1521, 'username', 'password', 'XE', 'SELECT * FROM dual');
77
* log(to_json(result));
78
* ```
79
*/
80
public ExecuteQuery(host: string, port: number, username: string, password: string, dbName: string, query: string): SQLResult | null {
81
return null;
82
}
83
84
/**
85
* ExecuteQueryWithDSN executes a query on an Oracle database using a DSN
86
* @example
87
* ```javascript
88
* const oracle = require('nuclei/oracle');
89
* const client = new oracle.OracleClient();
90
* const result = client.ExecuteQueryWithDSN('oracle://user:password@host:port/service', 'SELECT * FROM dual');
91
* log(to_json(result));
92
* ```
93
*/
94
public ExecuteQueryWithDSN(dsn: string, query: string): SQLResult | null {
95
return null;
96
}
97
}
98
99
/**
100
* SQLResult Interface
101
*/
102
export interface SQLResult {
103
Count?: number,
104
Columns?: string[],
105
Rows?: any[],
106
}
107
108