function parseConnectionsFromEnv(env) {
  const connectionsMap = Object.keys(env)
    .filter((key) => key.startsWith('SQLPAD_CONNECTIONS__'))
    .reduce((connectionsMap, envVar) => {
      // eslint-disable-next-line no-unused-vars
      const [prefix, id, field] = envVar.split('__');
      if (!connectionsMap[id]) {
        connectionsMap[id] = {};
      }
      connectionsMap[id][field] = env[envVar];
      return connectionsMap;
    }, {});

  const connectionsFromConfig = Object.entries(connectionsMap).map(
    ([id, connection]) => {
      connection.id = id;
      return connection;
    }
  );

  return connectionsFromConfig;
}
Parse connection env keys into key-value objects
Values contain only that defined in environment variables
This does not validate or clean the data in any way

Connection environment variables follow the format:
SQLPAD_CONNECTIONS__<connectionId>__<connectionFieldName>

Example: SQLPAD_CONNECTIONS__ab123__sqlserverEncrypt=""

@param {object} env