pub struct SqlitePipeline<I>where
I: ScrapedItem,{ /* private fields */ }Expand description
SQLite output pipeline. A pipeline that writes scraped items to a SQLite database. All database operations are offloaded to a dedicated blocking thread.
Implementations§
Source§impl<I> SqlitePipeline<I>where
I: ScrapedItem,
impl<I> SqlitePipeline<I>where
I: ScrapedItem,
Sourcepub fn new(
db_path: impl AsRef<Path>,
table_name: impl Into<String>,
) -> Result<SqlitePipeline<I>, PipelineError>
pub fn new( db_path: impl AsRef<Path>, table_name: impl Into<String>, ) -> Result<SqlitePipeline<I>, PipelineError>
Creates a new SqlitePipeline that writes items to the specified database path and table.
Sourcepub fn with_schema_export_config(
self,
config: SchemaExportConfig,
) -> SqlitePipeline<I>
pub fn with_schema_export_config( self, config: SchemaExportConfig, ) -> SqlitePipeline<I>
Applies typed export mapping before rows are written.
Trait Implementations§
Source§impl<I> Pipeline<I> for SqlitePipeline<I>where
I: ScrapedItem,
impl<I> Pipeline<I> for SqlitePipeline<I>where
I: ScrapedItem,
Source§fn process_item<'life0, 'async_trait>(
&'life0 self,
item: I,
) -> Pin<Box<dyn Future<Output = Result<Option<I>, PipelineError>> + Send + 'async_trait>>where
'life0: 'async_trait,
SqlitePipeline<I>: 'async_trait,
fn process_item<'life0, 'async_trait>(
&'life0 self,
item: I,
) -> Pin<Box<dyn Future<Output = Result<Option<I>, PipelineError>> + Send + 'async_trait>>where
'life0: 'async_trait,
SqlitePipeline<I>: 'async_trait,
Processes a single scraped item. Read more
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PipelineError>> + Send + 'async_trait>>where
'life0: 'async_trait,
SqlitePipeline<I>: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PipelineError>> + Send + 'async_trait>>where
'life0: 'async_trait,
SqlitePipeline<I>: 'async_trait,
Called when the spider is closing. Read more
Auto Trait Implementations§
impl<I> !Freeze for SqlitePipeline<I>
impl<I> !RefUnwindSafe for SqlitePipeline<I>
impl<I> Send for SqlitePipeline<I>
impl<I> Sync for SqlitePipeline<I>
impl<I> Unpin for SqlitePipeline<I>where
I: Unpin,
impl<I> UnwindSafe for SqlitePipeline<I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more