Skip to content

Commit d438ff5

Browse files
committed
Changelog
1 parent e329b5f commit d438ff5

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

PowerSync/PowerSync.Common/CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# PowerSync.Common Changelog
22

3+
## 0.0.10-alpha.1
4+
5+
- Fixed a bug where custom indexes were not being sent to the PowerSync SQLite extension.
6+
- Added a new model-based syntax for defining the PowerSync schema (the old syntax is still functional). This syntax uses classes marked with attributes to define the PowerSync schema. The classes can then also be used for queries later on.
7+
8+
```csharp
9+
using PowerSync.Common.DB.Schema;
10+
using PowerSync.Common.DB.Schema.Attributes;
11+
12+
[
13+
Table("todos"),
14+
Index("list", ["list_id"])
15+
]
16+
public class Todo
17+
{
18+
[Column("id")]
19+
public string TodoId { get; set; }
20+
21+
[Column("created_at")]
22+
public DateTime CreatedAt { get; set; }
23+
24+
[Column("name")]
25+
public string Name { get; set; }
26+
27+
[Column("description")]
28+
public string? Description { get; set; }
29+
30+
[Column("completed")]
31+
public bool Completed { get; set; }
32+
}
33+
34+
public class Schema
35+
{
36+
public static Schema AppSchema = new Schema(typeof(Todo));
37+
}
38+
39+
// Usage
40+
var todos = powerSync.GetAll<Todo>("SELECT * FROM todos");
41+
```
42+
343
## 0.0.9-alpha.1
444

545
- _Breaking:_ Further updated schema definition syntax.

PowerSync/PowerSync.Common/DB/Schema/Attributes/AttributeParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace PowerSync.Common.DB.Schema.Attributes;
44

55
using Dapper;
66

7-
internal class AttributeParser
7+
class AttributeParser
88
{
99
private readonly Type _type;
1010
private readonly TableAttribute _tableAttr;

0 commit comments

Comments
 (0)