@@ -2180,8 +2180,12 @@ def create_database(database: str, *, user: str=None, password: str=None, role:
2180
2180
raise ValueError (f"Configuration for server '{ db_config .server .value } ' not found" )
2181
2181
if user is None :
2182
2182
user = db_config .user .value
2183
+ if user is None :
2184
+ user = srv_config .user .value
2183
2185
if password is None :
2184
2186
password = db_config .password .value
2187
+ if password is None :
2188
+ password = srv_config .password .value
2185
2189
if role is None :
2186
2190
role = db_config .role .value
2187
2191
if charset is None :
@@ -4239,8 +4243,9 @@ def backup(self, *, database: FILESPEC, backup: Union[FILESPEC, Sequence[FILESPE
4239
4243
backup_file_sizes : Sequence [int ]= (),
4240
4244
flags : SrvBackupFlag = SrvBackupFlag .NONE , role : str = None ,
4241
4245
callback : CB_OUTPUT_LINE = None , stats : str = None ,
4242
- verbose : bool = False , skip_data : str = None , include_data : str = None ,
4243
- keyhoder : str = None , keyname : str = None , crypt : str = None ) -> None :
4246
+ verbose : bool = False , verbint : int = None , skip_data : str = None ,
4247
+ include_data : str = None , keyhoder : str = None , keyname : str = None ,
4248
+ crypt : str = None ) -> None :
4244
4249
"""Request logical (GBAK) database backup. **(ASYNC service)**
4245
4250
4246
4251
Arguments:
@@ -4252,6 +4257,7 @@ def backup(self, *, database: FILESPEC, backup: Union[FILESPEC, Sequence[FILESPE
4252
4257
callback: Function to call back with each output line.
4253
4258
stats: Backup statistic options (TDWR).
4254
4259
verbose: Whether output should be verbose or not.
4260
+ verbint: Verbose information with explicit interval (number of records)
4255
4261
skip_data: String with table names whose data should be excluded from backup.
4256
4262
include_data: String with table names whose data should be included into backup [Firebird 4].
4257
4263
keyholder: Keyholder name [Firebird 4]
@@ -4287,6 +4293,8 @@ def backup(self, *, database: FILESPEC, backup: Union[FILESPEC, Sequence[FILESPE
4287
4293
spb .insert_int (SPBItem .OPTIONS , flags )
4288
4294
if verbose :
4289
4295
spb .insert_tag (SPBItem .VERBOSE )
4296
+ if verbint is not None :
4297
+ spb .insert_int (SPBItem .VERBINT , verbint )
4290
4298
if stats :
4291
4299
spb .insert_string (SrvBackupOption .STAT , stats )
4292
4300
self ._srv ()._svc .start (spb .get_buffer ())
@@ -4298,10 +4306,11 @@ def restore(self, *, backup: Union[FILESPEC, Sequence[FILESPEC]],
4298
4306
db_file_pages : Sequence [int ]= (),
4299
4307
flags : SrvRestoreFlag = SrvRestoreFlag .CREATE , role : str = None ,
4300
4308
callback : CB_OUTPUT_LINE = None , stats : str = None ,
4301
- verbose : bool = True , skip_data : str = None , page_size : int = None ,
4302
- buffers : int = None , access_mode : DbAccessMode = DbAccessMode .READ_WRITE ,
4303
- include_data : str = None , keyhoder : str = None , keyname : str = None ,
4304
- crypt : str = None , replica_mode : ReplicaMode = None ) -> None :
4309
+ verbose : bool = False , verbint : int = None , skip_data : str = None ,
4310
+ page_size : int = None , buffers : int = None ,
4311
+ access_mode : DbAccessMode = DbAccessMode .READ_WRITE , include_data : str = None ,
4312
+ keyhoder : str = None , keyname : str = None , crypt : str = None ,
4313
+ replica_mode : ReplicaMode = None ) -> None :
4305
4314
"""Request database restore from logical (GBAK) backup. **(ASYNC service)**
4306
4315
4307
4316
Arguments:
@@ -4313,6 +4322,7 @@ def restore(self, *, backup: Union[FILESPEC, Sequence[FILESPEC]],
4313
4322
callback: Function to call back with each output line.
4314
4323
stats: Restore statistic options (TDWR).
4315
4324
verbose: Whether output should be verbose or not.
4325
+ verbint: Verbose information with explicit interval (number of records)
4316
4326
skip_data: String with table names whose data should be excluded from restore.
4317
4327
page_size: Page size for restored database.
4318
4328
buffers: Cache size for restored database.
@@ -4362,6 +4372,8 @@ def restore(self, *, backup: Union[FILESPEC, Sequence[FILESPEC]],
4362
4372
spb .insert_int (SPBItem .OPTIONS , flags )
4363
4373
if verbose :
4364
4374
spb .insert_tag (SPBItem .VERBOSE )
4375
+ if verbint is not None :
4376
+ spb .insert_int (SPBItem .VERBINT , verbint )
4365
4377
if stats :
4366
4378
spb .insert_string (SrvRestoreOption .STAT , stats )
4367
4379
self ._srv ()._svc .start (spb .get_buffer ())
@@ -5325,9 +5337,9 @@ def _read_output(self, *, init: str='', timeout: int=-1) -> None:
5325
5337
self ._eof = self .response .get_tag () == isc_info_end
5326
5338
else : # LINE mode
5327
5339
self ._eof = not data
5328
- while self .response .get_tag () == isc_info_truncated :
5340
+ while ( tag := self .response .get_tag () ) == isc_info_truncated :
5329
5341
data += self ._query_output (timeout )
5330
- if self . response . get_tag () != isc_info_end : # pragma: no cover
5342
+ if tag != isc_info_end : # pragma: no cover
5331
5343
raise InterfaceError ("Malformed result buffer (missing isc_info_end item)" )
5332
5344
init += data
5333
5345
if data and self .mode is SrvInfoCode .LINE :
0 commit comments