···147 Ok(count.count.unwrap_or(0))
148 }
149150- /// Gets all slice URIs that have lexicons defined.
151 ///
152- /// Useful for discovering all active slices in the system.
153 pub async fn get_all_slices(&self) -> Result<Vec<String>, DatabaseError> {
154 let rows: Vec<(String,)> = sqlx::query_as(
155 r#"
156- SELECT DISTINCT json->>'slice' as slice_uri
157 FROM record
158- WHERE collection = 'network.slices.lexicon'
159- AND json->>'slice' IS NOT NULL
160 "#,
161 )
162 .fetch_all(&self.pool)
···147 Ok(count.count.unwrap_or(0))
148 }
149150+ /// Gets all slice URIs from network.slices.slice records.
151 ///
152+ /// Returns all slices that exist in the system
153 pub async fn get_all_slices(&self) -> Result<Vec<String>, DatabaseError> {
154 let rows: Vec<(String,)> = sqlx::query_as(
155 r#"
156+ SELECT DISTINCT uri as slice_uri
157 FROM record
158+ WHERE collection = 'network.slices.slice'
0159 "#,
160 )
161 .fetch_all(&self.pool)