@@ -82,6 +82,7 @@ njsOracledb::njsOracledb()
82
82
poolTimeout = NJS_POOL_TIMEOUT;
83
83
fetchArraySize = DPI_DEFAULT_FETCH_ARRAY_SIZE;
84
84
connClass = " " ;
85
+ edition = " " ;
85
86
externalAuth = false ;
86
87
lobPrefetchSize = NJS_LOB_PREFETCH_SIZE;
87
88
poolPingInterval = NJS_POOL_DEFAULT_PING_INTERVAL;
@@ -156,6 +157,9 @@ void njsOracledb::Init(Handle<Object> target)
156
157
Nan::SetAccessor (temp->InstanceTemplate (),
157
158
Nan::New<v8::String>(" connectionClass" ).ToLocalChecked (),
158
159
njsOracledb::GetConnectionClass, njsOracledb::SetConnectionClass);
160
+ Nan::SetAccessor (temp->InstanceTemplate (),
161
+ Nan::New<v8::String>(" edition" ).ToLocalChecked (),
162
+ njsOracledb::GetEdition, njsOracledb::SetEdition);
159
163
Nan::SetAccessor (temp->InstanceTemplate (),
160
164
Nan::New<v8::String>(" externalAuth" ).ToLocalChecked (),
161
165
njsOracledb::GetExternalAuth, njsOracledb::SetExternalAuth);
@@ -604,6 +608,32 @@ NAN_SETTER(njsOracledb::SetConnectionClass)
604
608
" connectionClass" );
605
609
}
606
610
611
+ // -----------------------------------------------------------------------------
612
+ // njsOracledb::GetEdition()
613
+ // Get accessor of "edition" property.
614
+ // -----------------------------------------------------------------------------
615
+ NAN_GETTER (njsOracledb::GetEdition)
616
+ {
617
+ njsOracledb *oracledb = (njsOracledb*) ValidateGetter (info);
618
+ if (!oracledb)
619
+ return ;
620
+ Local<String> value =
621
+ Nan::New<v8::String>(oracledb->edition ).ToLocalChecked ();
622
+ info.GetReturnValue ().Set (value);
623
+ }
624
+
625
+ // -----------------------------------------------------------------------------
626
+ // njsOracledb::SetEdition()
627
+ // Set accessor of "edition" property.
628
+ // -----------------------------------------------------------------------------
629
+ NAN_SETTER (njsOracledb::SetEdition)
630
+ {
631
+ njsOracledb *oracledb = (njsOracledb*) ValidateSetter (info);
632
+ if (oracledb)
633
+ oracledb->SetPropString (value, &oracledb->edition ,
634
+ " edition" );
635
+ }
636
+
607
637
608
638
// -----------------------------------------------------------------------------
609
639
// njsOracledb::GetExternalAuth()
@@ -898,9 +928,11 @@ NAN_METHOD(njsOracledb::GetConnection)
898
928
baton->connectString );
899
929
baton->GetStringFromJSON (connProps, " newPassword" , 0 , baton->newPassword );
900
930
baton->connClass = oracledb->connClass ;
931
+ baton->edition = oracledb->edition ;
901
932
baton->stmtCacheSize = oracledb->stmtCacheSize ;
902
933
baton->externalAuth = oracledb->externalAuth ;
903
934
baton->events = oracledb->events ;
935
+ baton->GetStringFromJSON (connProps, " edition" , 0 , baton->edition );
904
936
baton->GetUnsignedIntFromJSON (connProps, " stmtCacheSize" , 0 ,
905
937
&baton->stmtCacheSize );
906
938
baton->GetUnsignedIntFromJSON (connProps, " privilege" , 0 ,
@@ -935,12 +967,18 @@ void njsOracledb::Async_GetConnection(njsBaton *baton)
935
967
params.connectionClass = baton->connClass .c_str ();
936
968
params.connectionClassLength = baton->connClass .length ();
937
969
}
970
+
938
971
if (!baton->newPassword .empty ()) {
939
972
params.newPassword = baton->newPassword .c_str ();
940
973
params.newPasswordLength = baton->newPassword .length ();
941
974
}
942
975
if (!InitCommonCreateParams (baton, &commonParams))
943
976
return ;
977
+ if (!baton->edition .empty ()) {
978
+ commonParams.edition = baton->edition .c_str ();
979
+ commonParams.editionLength = baton->edition .length ();
980
+ }
981
+
944
982
if (dpiConn_create (globalDPIContext, baton->user .c_str (),
945
983
(uint32_t ) baton->user .length (), baton->password .c_str (),
946
984
(uint32_t ) baton->password .length (), baton->connectString .c_str (),
@@ -1001,6 +1039,7 @@ NAN_METHOD(njsOracledb::CreatePool)
1001
1039
baton->poolPingInterval = oracledb->poolPingInterval ;
1002
1040
baton->stmtCacheSize = oracledb->stmtCacheSize ;
1003
1041
baton->externalAuth = oracledb->externalAuth ;
1042
+ baton->edition = oracledb->edition ;
1004
1043
baton->events = oracledb->events ;
1005
1044
baton->GetUnsignedIntFromJSON (poolProps, " poolMax" , 0 , &baton->poolMax );
1006
1045
baton->GetUnsignedIntFromJSON (poolProps, " poolMin" , 0 , &baton->poolMin );
@@ -1014,6 +1053,7 @@ NAN_METHOD(njsOracledb::CreatePool)
1014
1053
&baton->poolPingInterval );
1015
1054
baton->GetBoolFromJSON (poolProps, " externalAuth" , 0 , &baton->externalAuth );
1016
1055
baton->GetBoolFromJSON (poolProps, " events" , 0 , &baton->events );
1056
+ baton->GetStringFromJSON (poolProps, " edition" , 0 , baton->edition );
1017
1057
baton->lobPrefetchSize = oracledb->lobPrefetchSize ;
1018
1058
baton->jsOracledb .Reset (info.Holder ());
1019
1059
@@ -1044,6 +1084,10 @@ void njsOracledb::Async_CreatePool(njsBaton *baton)
1044
1084
params.pingInterval = baton->poolPingInterval ;
1045
1085
if (!InitCommonCreateParams (baton, &commonParams))
1046
1086
return ;
1087
+ if (!baton->edition .empty ()) {
1088
+ commonParams.edition = baton->edition .c_str ();
1089
+ commonParams.editionLength = baton->edition .length ();
1090
+ }
1047
1091
if (dpiPool_create (globalDPIContext, baton->user .c_str (),
1048
1092
(uint32_t ) baton->user .length (), baton->password .c_str (),
1049
1093
(uint32_t ) baton->password .length (), baton->connectString .c_str (),
0 commit comments