MCPcopy Create free account
hub / github.com/FastLED/FastLED / get_by_name

Method get_by_name

ci/docker_utils/container_db.py:114–143  ·  view source on GitHub ↗

Get container record by name. Args: container_name: Container name to look up Returns: ContainerRecord if found, None otherwise

(self, container_name: str)

Source from the content-addressed store, hash-verified

112 return sqlite3.connect(self.db_path, timeout=10.0)
113
114 def get_by_name(self, container_name: str) -> Optional[ContainerRecord]:
115 """Get container record by name.
116
117 Args:
118 container_name: Container name to look up
119
120 Returns:
121 ContainerRecord if found, None otherwise
122 """
123 conn = self._get_connection()
124 try:
125 cursor = conn.cursor()
126 cursor.execute(
127 "SELECT container_id, container_name, image_name, owner_pid, created_at, config_hash, platform_type FROM containers WHERE container_name = ?",
128 (container_name,),
129 )
130 row = cursor.fetchone()
131 if row:
132 return ContainerRecord(
133 container_id=row[0],
134 container_name=row[1],
135 image_name=row[2],
136 owner_pid=row[3],
137 created_at=row[4],
138 config_hash=row[5] if len(row) > 5 else "",
139 platform_type=row[6] if len(row) > 6 else "",
140 )
141 return None
142 finally:
143 conn.close()
144
145 def get_by_id(self, container_id: str) -> Optional[ContainerRecord]:
146 """Get container record by ID.

Callers 2

prepare_containerFunction · 0.95
test_record_operationsFunction · 0.95

Calls 4

_get_connectionMethod · 0.95
ContainerRecordClass · 0.85
executeMethod · 0.80
closeMethod · 0.45

Tested by 1

test_record_operationsFunction · 0.76