MCPcopy Create free account
hub / github.com/aws/aws-cli / _connection

Method _connection

awscli/autocomplete/db.py:35–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33
34 @property
35 def _connection(self):
36 if self._db_conn is None:
37 kwargs = {'check_same_thread': False, 'isolation_level': None}
38 if self._db_filename.startswith('file::memory:'):
39 # This statement was added because old versions of sqlite
40 # don't support 'uri' but we use it for tests and because
41 # in the tests we use only in-memory database we're looking
42 # for 'file::memory:' prefix if we decide to use 'uri' with
43 # sqlite more widely we can ease restrictions to 'file:'
44 kwargs['uri'] = True
45 self._db_conn = sqlite3.connect(self._db_filename, **kwargs)
46 self._ensure_database_setup()
47 return self._db_conn
48
49 def close(self):
50 self._connection.close()

Callers

nothing calls this directly

Calls 2

connectMethod · 0.45

Tested by

no test coverage detected