Skip to content

Commit

Permalink
Fix for database creation
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneLazzaris committed Jul 21, 2023
1 parent 025885e commit 64ebfa8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion immudb/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,19 @@ def createDatabaseV2(self, name: str, settings: datatypesv2.DatabaseSettingsV2,
Returns:
datatypesv2.CreateDatabaseResponseV2: Response contains information about new database
"""
rsettings=datatypesv2.ReplicationNullableSettings(
replica=schema_pb2.NullableBool(value=settings.replica),
masterDatabase=schema_pb2.NullableString(value=name),
masterAddress=schema_pb2.NullableString(value=settings.masterAddress),
masterPort=schema_pb2.NullableUint32(value=settings.masterPort),
followerUsername=schema_pb2.NullableString(value=settings.followerUsername),
followerPassword=schema_pb2.NullableString(value=settings.followerPassword),
)
nsettings=datatypesv2.DatabaseNullableSettings(
replicationSettings=rsettings
)
request = datatypesv2.CreateDatabaseRequest(
name=name, settings=settings, ifNotExists=ifNotExists)
name=name, settings=nsettings, ifNotExists=ifNotExists)
resp = self._stub.CreateDatabaseV2(request._getGRPC())
return dataconverter.convertResponse(resp)

Expand Down

0 comments on commit 64ebfa8

Please sign in to comment.