dolphindb 2.0.945 → 2.0.947
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser.d.ts +3 -2
- package/browser.js +5 -13
- package/browser.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/test.d.ts +1 -1
- package/test.js +4 -1
- package/test.js.map +1 -1
package/browser.d.ts
CHANGED
|
@@ -563,7 +563,9 @@ export declare class DDB {
|
|
|
563
563
|
private on_message;
|
|
564
564
|
private on_error;
|
|
565
565
|
/** 调用后会确保和数据库的连接是正常的 (this.connected === true && this.errored === false),否则抛出错误
|
|
566
|
-
这个方法是幂等的,首次调用建立实际的 WebSocket 连接到 URL 对应的 DolphinDB
|
|
566
|
+
这个方法是幂等的,首次调用建立实际的 WebSocket 连接到 URL 对应的 DolphinDB,然后执行自动登录,
|
|
567
|
+
如果是流数据连接,还会调用 publishTable 订阅流表
|
|
568
|
+
后续调用检查上面的条件
|
|
567
569
|
连接断开后禁止再次调用 connect 重连原有 ddb 对象,应该通过 new DDB() 的方式新建连接对象,原因是:
|
|
568
570
|
1. on_error 回调和某个 websocket 绑定了,不方便解绑后重新绑定
|
|
569
571
|
2. session 是有状态的,重连也无法恢复之前的状态
|
|
@@ -692,5 +694,4 @@ export interface DdbErrorMessage {
|
|
|
692
694
|
data: DdbDatabaseError;
|
|
693
695
|
}
|
|
694
696
|
export type DdbMessage = DdbPrintMessage | DdbObjectMessage | DdbErrorMessage;
|
|
695
|
-
export declare let ddb: DDB;
|
|
696
697
|
export {};
|
package/browser.js
CHANGED
|
@@ -2247,18 +2247,9 @@ export class DDB {
|
|
|
2247
2247
|
})
|
|
2248
2248
|
*/
|
|
2249
2249
|
constructor(url, options = {}) {
|
|
2250
|
-
const { searchParams, pathname } = new URL(location.href);
|
|
2251
|
-
if (!url) {
|
|
2252
|
-
const dev = pathname.endsWith('/console/');
|
|
2253
|
-
const hostname = searchParams.get('hostname') || (dev ? '127.0.0.1' : location.hostname);
|
|
2254
|
-
const port = searchParams.get('port') || (dev ? '8848' : location.port);
|
|
2255
|
-
url = `${dev ? (searchParams.get('tls') === '1' ? 'wss' : 'ws') : (location.protocol === 'https:' ? 'wss' : 'ws')}://${hostname}${port ? `:${port}` : ''}/`;
|
|
2256
|
-
}
|
|
2257
2250
|
this.url = url;
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
:
|
|
2261
|
-
options.verbose;
|
|
2251
|
+
if (options.verbose !== undefined)
|
|
2252
|
+
this.verbose = options.verbose;
|
|
2262
2253
|
if (options.autologin !== undefined)
|
|
2263
2254
|
this.autologin = options.autologin;
|
|
2264
2255
|
if (options.username !== undefined)
|
|
@@ -2277,7 +2268,9 @@ export class DDB {
|
|
|
2277
2268
|
// 这里的实现一定会被 connect, rpc 中的实现覆盖
|
|
2278
2269
|
}
|
|
2279
2270
|
/** 调用后会确保和数据库的连接是正常的 (this.connected === true && this.errored === false),否则抛出错误
|
|
2280
|
-
这个方法是幂等的,首次调用建立实际的 WebSocket 连接到 URL 对应的 DolphinDB
|
|
2271
|
+
这个方法是幂等的,首次调用建立实际的 WebSocket 连接到 URL 对应的 DolphinDB,然后执行自动登录,
|
|
2272
|
+
如果是流数据连接,还会调用 publishTable 订阅流表
|
|
2273
|
+
后续调用检查上面的条件
|
|
2281
2274
|
连接断开后禁止再次调用 connect 重连原有 ddb 对象,应该通过 new DDB() 的方式新建连接对象,原因是:
|
|
2282
2275
|
1. on_error 回调和某个 websocket 绑定了,不方便解绑后重新绑定
|
|
2283
2276
|
2. session 是有状态的,重连也无法恢复之前的状态
|
|
@@ -2758,5 +2751,4 @@ export class DDB {
|
|
|
2758
2751
|
return this.streaming;
|
|
2759
2752
|
}
|
|
2760
2753
|
}
|
|
2761
|
-
export let ddb = window.ddb = new DDB();
|
|
2762
2754
|
//# sourceMappingURL=browser.js.map
|