Skip to content

Commit b8fb204

Browse files
Copilotgraknol
andauthored
Add Algolia DocSearch integration with sitemap and enhanced documentation (#45)
* Initial plan * Add explicit sitemap configuration for Algolia crawler efficiency Co-authored-by: graknol <[email protected]> * Add tasteful emojis to documentation for better readability Co-authored-by: graknol <[email protected]> * Add trailing slashes to all URLs to avoid redirects for Algolia crawler Co-authored-by: graknol <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: graknol <[email protected]>
1 parent 87c050d commit b8fb204

17 files changed

+78
-52
lines changed

docs/ALGOLIA_SEARCH_SETUP.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ algolia: {
2626
},
2727
```
2828

29+
### Sitemap Configuration
30+
31+
A sitemap is automatically generated to help the Algolia crawler efficiently index the documentation. The sitemap configuration is in the preset options:
32+
33+
```typescript
34+
sitemap: {
35+
lastmod: 'date',
36+
changefreq: 'weekly',
37+
priority: 0.5,
38+
ignorePatterns: ['/tags/**'],
39+
filename: 'sitemap.xml',
40+
},
41+
```
42+
43+
The generated sitemap is available at `https://declarative-sqlite.linden.no/sitemap.xml` after deployment. This helps Algolia's crawler discover and index all documentation pages more efficiently.
44+
2945
## Setup Steps
3046

3147
To complete the Algolia search setup with your open source key:

docs/docs/core-library/data-modeling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 4
33
---
44

5-
# Data Modeling with DbRecord
5+
# 🎯 Data Modeling with DbRecord
66

77
While working with raw `Map<String, Object?>` objects is flexible, it's not type-safe and can be error-prone. `declarative_sqlite` provides a `DbRecord` base class to help you create strongly-typed data models that map directly to your database tables and work seamlessly with the query system.
88

docs/docs/core-library/data-synchronization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 6
33
---
44

5-
# Data Synchronization
5+
# 🔄 Data Synchronization
66

77
`declarative_sqlite` provides a powerful, built-in framework for implementing offline-first data synchronization. This allows your application to work seamlessly offline and sync its data with a remote server whenever a network connection is available.
88

docs/docs/core-library/file-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 5
33
---
44

5-
# File Management
5+
# 📁 File Management
66

77
`declarative_sqlite` provides a robust, integrated system for managing file attachments associated with your database records. This is useful for any application that needs to store user-generated content like images, documents, or other binary data.
88

docs/docs/core-library/intro.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
sidebar_position: 1
33
---
44

5-
# Introduction
5+
# 💪 Introduction
66

77
The core `declarative_sqlite` library is the powerhouse of the ecosystem. It contains all the essential tools for defining your schema, managing migrations, querying data, and handling Last-Writer-Wins conflict resolution.
88

99
This section provides a deep dive into the advanced features of the core library.
1010

11-
## Key Feature Areas
11+
## 🎯 Key Feature Areas
1212

13-
### Querying
13+
### 🔍 Querying
1414
- **Query Builder**: A fluent, type-safe API for constructing complex SQL queries. It supports `SELECT`, `JOIN`, `WHERE`, `GROUP BY`, `ORDER BY`, and more, reducing the risk of syntax errors.
1515
- **Streaming Queries**: The foundation for building reactive applications. These queries return a `StreamingQuery` that automatically emits a new list of results whenever the underlying data changes. The library performs sophisticated dependency analysis to ensure that streams are only updated when relevant data is modified.
1616

17-
### Data Modeling
17+
### 📊 Data Modeling
1818
- **`DbRecord` and Code Generation**: A pattern for creating typed data models that map directly to your database tables. The `declarative_sqlite_generator` package can be used to automatically generate typed getters for all columns and setters for LWW columns, eliminating boilerplate and improving code safety.
1919
- **File Management**: A robust system for associating files with your database records. The `fileset` column type allows you to manage collections of files, with built-in support for adding, retrieving, deleting, and garbage-collecting file assets.
2020

21-
### LWW Conflict Resolution
21+
### 🔄 LWW Conflict Resolution
2222
- **Hybrid Logical Clock (HLC)**: Used for Last-Writer-Wins (LWW) columns, the HLC is a timestamping mechanism that combines physical time with a logical counter. This ensures consistent conflict resolution when the same data is modified from multiple sources.
2323
- **LWW Columns**: Special column type that automatically tracks the last modification time using HLC timestamps, enabling conflict-free data merging in distributed scenarios.
2424

25-
## What You'll Learn
25+
## 📖 What You'll Learn
2626

2727
In this section, you will learn how to:
2828
- Build complex, multi-table queries with the **Query Builder**.

docs/docs/core-library/query-builder.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
sidebar_position: 2
33
---
44

5-
# Query Builder
5+
# 🔍 Query Builder
66

77
The query builder provides a fluent, type-safe API for constructing SQL queries. It helps prevent syntax errors and makes your data access logic more readable and maintainable than raw SQL strings.
88

99
You can access the query builder in two ways:
1010
1. By passing a callback to `database.query()`.
1111
2. By creating a `QueryBuilder` instance directly to generate a raw SQL string.
1212

13-
## Selecting Columns (`select`)
13+
## 📝 Selecting Columns (`select`)
1414

1515
The `select` method specifies which columns to return. You can pass simple column names, aliases, or even complex expressions.
1616

@@ -25,7 +25,7 @@ q.select('u.name as author_name, p.title as post_title')
2525
q.select('COUNT(*) as total_tasks, AVG(priority) as avg_priority')
2626
```
2727

28-
## Specifying the Source (`from`)
28+
## 🗂️ Specifying the Source (`from`)
2929

3030
The `from` method specifies the main table for the query. You can also provide an alias for the table, which is highly recommended, especially when performing joins.
3131

@@ -37,7 +37,7 @@ q.from('tasks')
3737
q.from('tasks', 't')
3838
```
3939

40-
## Joining Tables (`join`)
40+
## 🔗 Joining Tables (`join`)
4141

4242
You can join additional tables using the `join`, `leftJoin`, `rightJoin`, and `innerJoin` methods.
4343

@@ -47,7 +47,7 @@ q.select('t.title, u.name as author')
4747
.innerJoin('users', col('t.user_id').eq(col('u.id')), 'u')
4848
```
4949

50-
## Filtering Results (`where`)
50+
## 🎯 Filtering Results (`where`)
5151

5252
The `where` method filters the results. It accepts a `WhereClause` object, which can be constructed using helper functions.
5353

docs/docs/core-library/streaming-queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 3
33
---
44

5-
# Streaming Queries
5+
# 🌊 Streaming Queries
66

77
Streaming queries are the cornerstone of building reactive applications with `declarative_sqlite`. Instead of fetching data just once, a streaming query returns a `Stream` that automatically emits a new, updated list of results whenever the underlying data changes.
88

docs/docs/flutter-integration/database-provider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 2
33
---
44

5-
# DatabaseProvider
5+
# 🗄️ DatabaseProvider
66

77
`DatabaseProvider` is an `InheritedWidget` that simplifies the management and accessibility of your `DeclarativeDatabase` instance within a Flutter application.
88

docs/docs/flutter-integration/intro.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
sidebar_position: 1
33
---
44

5-
# Introduction
5+
# 📱 Introduction
66

77
The `declarative_sqlite_flutter` package provides a set of widgets and helpers specifically designed to bridge the gap between the core database library and a Flutter application. These tools simplify state management, database lifecycle, and UI updates, allowing you to build reactive, data-driven interfaces with minimal boilerplate.
88

9-
## Key Components
9+
## 🔧 Key Components
1010

11-
### `DatabaseProvider`
11+
### 🗄️ `DatabaseProvider`
1212
A Flutter `InheritedWidget` that handles the initialization and lifecycle of your `DeclarativeDatabase` instance. It ensures that your database is opened when the widget is created, closed when it's disposed, and made available to all descendant widgets in the tree. This is the recommended way to manage your database instance in a Flutter app.
1313

14-
### `QueryListView`
14+
### 📋 `QueryListView`
1515
A powerful, reactive `ListView` that is directly connected to a `StreamingQuery`. It automatically listens for data changes and rebuilds its list of items when the query results are updated. It handles all the complexities of stream subscriptions, state management, and efficient UI updates for lists of data.
1616

17-
## What You'll Learn
17+
## 📖 What You'll Learn
1818

1919
In this section, you will learn how to:
2020
- Properly manage your database lifecycle using **`DatabaseProvider`**.

docs/docs/flutter-integration/query-list-view.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 3
33
---
44

5-
# QueryListView
5+
# 📋 QueryListView
66

77
`QueryListView` is a specialized Flutter widget that simplifies the process of displaying a list of data from a `declarative_sqlite` streaming query. It's a reactive `ListView` that automatically updates its contents when the underlying data in the database changes.
88

0 commit comments

Comments
 (0)