Skip to content

Commit 87f89f7

Browse files
- Adds documentations in the open-source repository, so they can be updated and created by contributors.
- Adds issue and PR templates. - Renamed "Scripts" folder to "scripts" to keep naming conventions consitent.
1 parent 96349af commit 87f89f7

31 files changed

Lines changed: 2695 additions & 8 deletions
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Bug Report
2+
description: Report a bug in Eftdb
3+
labels: ["bug"]
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
description: A clear and concise description of the bug.
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
id: steps-to-reproduce
15+
attributes:
16+
label: Steps to reproduce
17+
description: Minimal steps to reproduce the behavior.
18+
placeholder: |
19+
1. Configure entity with ...
20+
2. Run migration ...
21+
3. See error ...
22+
validations:
23+
required: true
24+
25+
- type: textarea
26+
id: expected-behavior
27+
attributes:
28+
label: Expected behavior
29+
description: What you expected to happen.
30+
validations:
31+
required: true
32+
33+
- type: input
34+
id: dotnet-version
35+
attributes:
36+
label: .NET version
37+
placeholder: "e.g. 10.0.0"
38+
validations:
39+
required: false
40+
41+
- type: input
42+
id: timescaledb-version
43+
attributes:
44+
label: TimescaleDB version
45+
placeholder: "e.g. 2.17.2"
46+
validations:
47+
required: false
48+
49+
- type: input
50+
id: eftdb-version
51+
attributes:
52+
label: Eftdb version
53+
placeholder: "e.g. 10.0.0"
54+
validations:
55+
required: false
56+
57+
- type: textarea
58+
id: additional-context
59+
attributes:
60+
label: Additional context
61+
description: Any other context, screenshots, or log output relevant to the issue.
62+
validations:
63+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Questions & Discussion
4+
url: https://github.com/cmdscale/CmdScale.EntityFrameworkCore.TimescaleDB/issues
5+
about: For general questions, open a discussion or browse existing issues.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Documentation
2+
description: Report missing or incorrect documentation
3+
labels: ["documentation"]
4+
body:
5+
- type: textarea
6+
id: what-needs-documenting
7+
attributes:
8+
label: What needs documenting
9+
description: Describe the topic or area that needs documentation.
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
id: suggested-content
15+
attributes:
16+
label: Suggested content
17+
description: If you have ideas for what the documentation should include, describe them here.
18+
validations:
19+
required: false
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Feature Request
2+
description: Suggest a new feature or improvement
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
description: A clear and concise description of the feature.
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
id: use-case
15+
attributes:
16+
label: Use case / motivation
17+
description: Why is this feature needed? What problem does it solve?
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: proposed-solution
23+
attributes:
24+
label: Proposed solution
25+
description: How you think the feature could be implemented.
26+
validations:
27+
required: false
28+
29+
- type: textarea
30+
id: alternatives-considered
31+
attributes:
32+
label: Alternatives considered
33+
description: Any alternative solutions or workarounds you've considered.
34+
validations:
35+
required: false
36+
37+
- type: textarea
38+
id: additional-context
39+
attributes:
40+
label: Additional context
41+
description: Any other context, mockups, or references relevant to the request.
42+
validations:
43+
required: false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Description
2+
3+
<!-- Briefly describe what this PR does and why. -->
4+
5+
## Related Issues
6+
7+
<!-- Link any related issues, e.g. "Closes #123" or "Relates to #456". -->
8+
9+
## Type of Change
10+
11+
- [ ] Bug fix (non-breaking change adressing an issue)
12+
- [ ] New feature (non-breaking change adding functionality)
13+
- [ ] Refactoring
14+
- [ ] Documentation
15+
- [ ] CI / build / tooling
16+
- [ ] Breaking change (fix or feature causing existing functionality to change)
17+
18+
## Test Plan
19+
20+
- [ ] Unit tests added/updated
21+
- [ ] Integration tests added/updated (Testcontainers)
22+
- [ ] Existing tests pass (`dotnet test`)
23+
24+
## Checklist
25+
26+
- [ ] Code follows the project's coding styles and guidelines
27+
- [ ] I have updated the documentation accordingly
28+
- [ ] I have added tests to cover my changes
29+
- [ ] No new compiler warnings introduced
30+
- [ ] Public API changes have XML documentation
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Notify Docs Update
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
10+
jobs:
11+
dispatch:
12+
name: Trigger website rebuild
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Repository Dispatch
16+
uses: peter-evans/repository-dispatch@v3
17+
with:
18+
token: ${{ secrets.ADMIN_PAT }}
19+
repository: cmdscale/efcore-timescale-website
20+
event-type: docs-updated

CmdScale.EntityFrameworkCore.TimescaleDB.sln

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 18
4-
VisualStudioVersion = 18.0.11217.181 d18.0
4+
VisualStudioVersion = 18.0.11217.181
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
77
ProjectSection(SolutionItems) = preProject
88
.editorconfig = .editorconfig
99
.gitignore = .gitignore
1010
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
1111
docker-compose.yml = docker-compose.yml
12+
scripts\Publish-Local.ps1 = scripts\Publish-Local.ps1
1213
README.md = README.md
13-
Scripts\Publish-Local.ps1 = Scripts\Publish-Local.ps1
14-
Scripts\Switch-References.ps1 = Scripts\Switch-References.ps1
14+
scripts\Switch-References.ps1 = scripts\Switch-References.ps1
1515
EndProjectSection
1616
EndProject
1717
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
@@ -44,6 +44,41 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Eftdb.Samples.DatabaseFirst
4444
EndProject
4545
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Eftdb.Samples.DatabaseFirst", "samples\Eftdb.Samples.DatabaseFirst\Eftdb.Samples.DatabaseFirst.csproj", "{2FBA55BC-14C9-4137-B7D9-65920624C4FD}"
4646
EndProject
47+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{DD66FBE1-746C-4022-8D68-20DF5E65C902}"
48+
ProjectSection(SolutionItems) = preProject
49+
docs\00-getting-started.md = docs\00-getting-started.md
50+
docs\01-dotnet-tools.md = docs\01-dotnet-tools.md
51+
EndProjectSection
52+
EndProject
53+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "data-annotations", "data-annotations", "{97EBA3D4-DBB9-4564-B45B-D6ECF3A077DF}"
54+
ProjectSection(SolutionItems) = preProject
55+
docs\data-annotations\continuous-aggregates.md = docs\data-annotations\continuous-aggregates.md
56+
docs\data-annotations\hypertable.md = docs\data-annotations\hypertable.md
57+
docs\data-annotations\reorder-policies.md = docs\data-annotations\reorder-policies.md
58+
EndProjectSection
59+
EndProject
60+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fluent-api", "fluent-api", "{4FA5831A-43BD-41BD-9893-0617902290BD}"
61+
ProjectSection(SolutionItems) = preProject
62+
docs\fluent-api\continuous-aggregates.md = docs\fluent-api\continuous-aggregates.md
63+
docs\fluent-api\hypertable.md = docs\fluent-api\hypertable.md
64+
docs\fluent-api\reorder-policies.md = docs\fluent-api\reorder-policies.md
65+
EndProjectSection
66+
EndProject
67+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "release-notes", "release-notes", "{84C9CCAD-8CA8-47E7-9473-92C5B4578818}"
68+
ProjectSection(SolutionItems) = preProject
69+
docs\release-notes\v0.1.5.md = docs\release-notes\v0.1.5.md
70+
docs\release-notes\v0.2.0.md = docs\release-notes\v0.2.0.md
71+
docs\release-notes\v0.2.1.md = docs\release-notes\v0.2.1.md
72+
docs\release-notes\v0.2.2.md = docs\release-notes\v0.2.2.md
73+
docs\release-notes\v0.2.3.md = docs\release-notes\v0.2.3.md
74+
docs\release-notes\v0.2.4.md = docs\release-notes\v0.2.4.md
75+
docs\release-notes\v0.3.0.md = docs\release-notes\v0.3.0.md
76+
docs\release-notes\v0.3.1.md = docs\release-notes\v0.3.1.md
77+
docs\release-notes\v0.3.2.md = docs\release-notes\v0.3.2.md
78+
docs\release-notes\v0.3.3.md = docs\release-notes\v0.3.3.md
79+
docs\release-notes\v10.0.1.md = docs\release-notes\v10.0.1.md
80+
EndProjectSection
81+
EndProject
4782
Global
4883
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4984
Debug|Any CPU = Debug|Any CPU
@@ -166,6 +201,9 @@ Global
166201
{0AE92D9A-B5B8-44CC-AD65-F4256CCAB15A} = {EA8E3935-33B2-4D96-A294-5488AE39A401}
167202
{90DFE874-FC84-218F-EDC2-090609ACD664} = {5D20AA90-6969-D8BD-9DCD-8634F4692FDA}
168203
{2FBA55BC-14C9-4137-B7D9-65920624C4FD} = {90DFE874-FC84-218F-EDC2-090609ACD664}
204+
{97EBA3D4-DBB9-4564-B45B-D6ECF3A077DF} = {DD66FBE1-746C-4022-8D68-20DF5E65C902}
205+
{4FA5831A-43BD-41BD-9893-0617902290BD} = {DD66FBE1-746C-4022-8D68-20DF5E65C902}
206+
{84C9CCAD-8CA8-47E7-9473-92C5B4578818} = {DD66FBE1-746C-4022-8D68-20DF5E65C902}
169207
EndGlobalSection
170208
GlobalSection(ExtensibilityGlobals) = postSolution
171209
SolutionGuid = {5CCFF438-FD53-473A-96B6-4D69BA8E7166}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@ These script modify your `.csproj` files to switch between referencing the core
247247
Switch to **project references** (ideal for active development):
248248

249249
```powershell
250-
.\Scripts\Switch-References.ps1 -Mode Project
250+
.\scripts\Switch-References.ps1 -Mode Project
251251
```
252252

253253
Switch to **NuGet package references** (to simulate a real-world consumer):
254254

255255
```powershell
256-
.\Scripts\Switch-References.ps1 -Mode Package
256+
.\scripts\Switch-References.ps1 -Mode Package
257257
```
258258

259259
---
@@ -264,10 +264,10 @@ To build and publish the core libraries to a local NuGet feed for testing, use t
264264

265265
```powershell
266266
# Publish the design-time package
267-
.\Scripts\Publish-Local.ps1 -ProjectName "Eftdb.Design"
267+
.\scripts\Publish-Local.ps1 -ProjectName "Eftdb.Design"
268268
269269
# Publish the runtime package
270-
.\Scripts\Publish-Local.ps1 -ProjectName "Eftdb"
270+
.\scripts\Publish-Local.ps1 -ProjectName "Eftdb"
271271
```
272272

273273
> To change this path, edit the `$LocalNuGetRepo` variable inside the `Publish-Local.ps1` script.

Scripts/Switch-References.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ try {
135135

136136
$PublishedVersions = @{}
137137
# Path to the new, single publish script in the solution root
138-
$publishScript = Join-Path $SolutionRoot ".\Scripts\Publish-Local.ps1"
138+
$publishScript = Join-Path $SolutionRoot ".\scripts\Publish-Local.ps1"
139139

140140
if (-not (Test-Path $publishScript)) {
141141
throw "The central Publish-Local.ps1 script was not found in the solution root."

docs/00-getting-started.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
slug: /
3+
---
4+
5+
# Getting started
6+
7+
Follow these simple steps to integrate **TimescaleDB** with your Entity Framework Core application using the `CmdScale.EntityFrameworkCore.TimescaleDB` NuGet packages.
8+
9+
You may also want to checkout the eample projects in the [repository](https://github.com/cmdscale/CmdScale.EntityFrameworkCore.TimescaleDB).
10+
11+
---
12+
13+
## Getting Started Steps
14+
15+
### Step 1: Install NuGet Packages
16+
17+
**Description:** Add the required packages to your project. These packages provide the core runtime integration and design-time support for EF Core tooling and migrations.
18+
19+
**Code:**
20+
21+
```bash
22+
dotnet add package CmdScale.EntityFrameworkCore.TimescaleDB
23+
dotnet add package CmdScale.EntityFrameworkCore.TimescaleDB.Design
24+
```
25+
26+
---
27+
28+
### Step 2: Configure DbContext
29+
30+
**Description:** Enable TimescaleDB support in your `DbContext` configuration with a single line of code by chaining the `.UseTimescaleDb()` method onto your PostgreSQL provider configuration.
31+
32+
**Code:** `
33+
34+
```csharp
35+
string? connectionString = builder.Configuration.GetConnectionString("Timescale");
36+
37+
builder.Services.AddDbContext<TimescaleContext>(options =>
38+
options.UseNpgsql(connectionString).UseTimescaleDb());
39+
```
40+
41+
---
42+
43+
### Step 3: Define Your Models
44+
45+
**Description:** Use familiar EF Core patterns to define **hypertables** using [Data Annotations](/category/data-annotations/) or the [Fluent API](/category/fluent-api/). The example below uses the `[Hypertable]` and `[PrimaryKey]` attributes.
46+
47+
**Code:**
48+
49+
```csharp
50+
[Hypertable(nameof(Time), ChunkSkipColumns = new[] { "Time" }, ChunkTimeInterval = "86400000")]
51+
[PrimaryKey(nameof(Id), nameof(Time))]
52+
public class DeviceReading
53+
{
54+
public Guid Id { get; set; }
55+
public DateTime Time { get; set; }
56+
public string DeviceId { get; set; } = string.Empty;
57+
public double Voltage { get; set; }
58+
public double Power { get; set; }
59+
}
60+
```

0 commit comments

Comments
 (0)