withModuleAliases method

Client withModuleAliases(
  1. Map<String, String> aliases
)

Returns a new Client instance with the specified module aliases.

The aliases parameter is merged with any existing module aliases defined on the current client instance.

If the alias name is 'module' this is equivalent to using the set module command, otherwise it is equivalent to the set alias command.

Example:

final user = await client.withModuleAliases({
  'module': 'sys'
}).querySingle('''
  select get_version_as_str()
''');
// "2.0"

Implementation

Client withModuleAliases(Map<String, String> aliases) {
  return Client._create(_pool,
      _options.withSession(_options.session.withModuleAliases(aliases)));
}