mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-10 23:45:58 -06:00
1) Added --exclude-database option for Backup Server.
2) Fixed Jasmine test cases.
This commit is contained in:
parent
115d4afd9e
commit
7686280cb2
@ -178,6 +178,9 @@ tab to provide other backup options.
|
|||||||
table locks at the beginning of the dump. Instead, fail if unable to lock a
|
table locks at the beginning of the dump. Instead, fail if unable to lock a
|
||||||
table within the specified timeout.
|
table within the specified timeout.
|
||||||
|
|
||||||
|
* Use the *Exclude database* field to not dump databases whose name matches
|
||||||
|
pattern.
|
||||||
|
|
||||||
When you’ve specified the details that will be incorporated into the pg_dumpall
|
When you’ve specified the details that will be incorporated into the pg_dumpall
|
||||||
command:
|
command:
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ def _get_args_params_values(data, conn, backup_obj_type, backup_file, server,
|
|||||||
|
|
||||||
# --blobs is deprecated from v16
|
# --blobs is deprecated from v16
|
||||||
if manager.version >= 160000:
|
if manager.version >= 160000:
|
||||||
set_param('blobs', 'large-objects',
|
set_param('blobs', '--large-objects',
|
||||||
data['format'] in ['custom', 'tar'])
|
data['format'] in ['custom', 'tar'])
|
||||||
else:
|
else:
|
||||||
set_param('blobs', '--blobs', data['format'] in ['custom', 'tar'])
|
set_param('blobs', '--blobs', data['format'] in ['custom', 'tar'])
|
||||||
@ -334,6 +334,8 @@ def _get_args_params_values(data, conn, backup_obj_type, backup_file, server,
|
|||||||
set_value('extra_float_digits', '--extra-float-digits', None,
|
set_value('extra_float_digits', '--extra-float-digits', None,
|
||||||
manager.version >= 120000)
|
manager.version >= 120000)
|
||||||
set_value('lock_wait_timeout', '--lock-wait-timeout')
|
set_value('lock_wait_timeout', '--lock-wait-timeout')
|
||||||
|
set_value('exclude_database', '--exclude-database', None,
|
||||||
|
manager.version >= 160000)
|
||||||
|
|
||||||
args.extend(
|
args.extend(
|
||||||
functools.reduce(operator.iconcat, map(
|
functools.reduce(operator.iconcat, map(
|
||||||
|
@ -341,6 +341,7 @@ export class MiscellaneousSchema extends BaseUISchema {
|
|||||||
|
|
||||||
|
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
let obj = this;
|
||||||
return [{
|
return [{
|
||||||
id: 'verbose',
|
id: 'verbose',
|
||||||
label: gettext('Verbose messages'),
|
label: gettext('Verbose messages'),
|
||||||
@ -372,6 +373,14 @@ export class MiscellaneousSchema extends BaseUISchema {
|
|||||||
type: 'int',
|
type: 'int',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
group: gettext('Miscellaneous')
|
group: gettext('Miscellaneous')
|
||||||
|
}, {
|
||||||
|
id: 'exclude_database',
|
||||||
|
label: gettext('Exclude database'),
|
||||||
|
type: 'text',
|
||||||
|
disabled: false,
|
||||||
|
min_version: 160000,
|
||||||
|
group: gettext('Miscellaneous'),
|
||||||
|
visible: isVisibleForObjectBackup(obj.backupType)
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1052,6 +1052,31 @@ class BackupCreateJobTest(BaseTestGenerator):
|
|||||||
not_expected_cmd_opts=[],
|
not_expected_cmd_opts=[],
|
||||||
expected_exit_code=[0, None]
|
expected_exit_code=[0, None]
|
||||||
)),
|
)),
|
||||||
|
('When backup the server with option - Exclude database',
|
||||||
|
dict(
|
||||||
|
class_params=dict(
|
||||||
|
sid=1,
|
||||||
|
name='test_backup_server',
|
||||||
|
port=5444,
|
||||||
|
host='localhost',
|
||||||
|
database='postgres',
|
||||||
|
bfile='test_backup',
|
||||||
|
username='postgres'
|
||||||
|
),
|
||||||
|
params=dict(
|
||||||
|
file='test_backup_server_file',
|
||||||
|
type='server',
|
||||||
|
verbose=True,
|
||||||
|
exclude_database="db*"
|
||||||
|
),
|
||||||
|
url=BACKUP_SERVER_URL,
|
||||||
|
expected_cmd_opts=[VERBOSE, '--exclude-database', 'db*'],
|
||||||
|
not_expected_cmd_opts=[],
|
||||||
|
server_min_version=160000,
|
||||||
|
expected_exit_code=[0, None],
|
||||||
|
message='Backup server with --exclude-database are not '
|
||||||
|
'supported by EPAS/PG server less than 16.0'
|
||||||
|
)),
|
||||||
('When backup the server with encoding',
|
('When backup the server with encoding',
|
||||||
dict(
|
dict(
|
||||||
class_params=dict(
|
class_params=dict(
|
||||||
|
@ -12,7 +12,7 @@ import '../helper/enzyme.helper';
|
|||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
import pgAdmin from 'sources/pgadmin';
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
||||||
import BackupSchema, {getSectionSchema, getTypeObjSchema, getSaveOptSchema, getQueryOptionSchema, getDisabledOptionSchema, getMiscellaneousSchema} from '../../../pgadmin/tools/backup/static/js/backup.ui';
|
import BackupSchema, {getSectionSchema, getTypeObjSchema, getSaveOptSchema, getDisabledOptionSchema, getMiscellaneousSchema} from '../../../pgadmin/tools/backup/static/js/backup.ui';
|
||||||
import Theme from '../../../pgadmin/static/js/Theme';
|
import Theme from '../../../pgadmin/static/js/Theme';
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +29,6 @@ describe('BackupSchema', ()=>{
|
|||||||
()=> getSectionSchema(),
|
()=> getSectionSchema(),
|
||||||
()=> getTypeObjSchema(),
|
()=> getTypeObjSchema(),
|
||||||
()=> getSaveOptSchema({nodeInfo: {server: {version: 11000}}}),
|
()=> getSaveOptSchema({nodeInfo: {server: {version: 11000}}}),
|
||||||
()=> getQueryOptionSchema({nodeInfo: {server: {version: 11000}}}),
|
|
||||||
()=> getDisabledOptionSchema({nodeInfo: {server: {version: 11000}}}),
|
()=> getDisabledOptionSchema({nodeInfo: {server: {version: 11000}}}),
|
||||||
()=> getMiscellaneousSchema({nodeInfo: {server: {version: 11000}}}),
|
()=> getMiscellaneousSchema({nodeInfo: {server: {version: 11000}}}),
|
||||||
{
|
{
|
||||||
@ -66,7 +65,6 @@ describe('BackupSchema', ()=>{
|
|||||||
()=> getSectionSchema(),
|
()=> getSectionSchema(),
|
||||||
()=> getTypeObjSchema(),
|
()=> getTypeObjSchema(),
|
||||||
()=> getSaveOptSchema({nodeInfo: {server: {version: 11000}}}),
|
()=> getSaveOptSchema({nodeInfo: {server: {version: 11000}}}),
|
||||||
()=> getQueryOptionSchema({nodeInfo: {server: {version: 11000}}}),
|
|
||||||
()=> getDisabledOptionSchema({nodeInfo: {server: {version: 11000}}}),
|
()=> getDisabledOptionSchema({nodeInfo: {server: {version: 11000}}}),
|
||||||
()=> getMiscellaneousSchema({nodeInfo: {server: {version: 11000}}}),
|
()=> getMiscellaneousSchema({nodeInfo: {server: {version: 11000}}}),
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user