You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ This repository provides the essential libraries and tooling to seamlessly integ
12
12
13
13
-**CmdScale.EntityFrameworkCore.TimescaleDB**: The core runtime library. You include this in your project to enable TimescaleDB-specific features when configuring your `DbContext`.
14
14
-**CmdScale.EntityFrameworkCore.TimescaleDB.Design**: Provides crucial design-time extensions. This package enhances the EF Core CLI tools (`dotnet ef`) to understand TimescaleDB concepts, enabling correct schema generation for migrations and scaffolding.
The Fluent API provides a powerful, type-safe way to configure your entities. Use the `.IsHypertable()` extension method on an entity builder to designate it as a hypertable and configure its properties.
74
77
75
78
### Model
79
+
76
80
A standard POCO class representing our time-series data.
81
+
77
82
```csharp
78
83
publicclassWeatherData
79
84
{
@@ -85,7 +90,9 @@ public class WeatherData
85
90
```
86
91
87
92
### Configuration
93
+
88
94
In a separate configuration class, you can define the hypertable settings.
@@ -109,6 +116,7 @@ public class WeatherDataConfiguration : IEntityTypeConfiguration<WeatherData>
109
116
---
110
117
111
118
## 🏷️ Data Annotations Example
119
+
112
120
For simpler configurations, you can use the [Hypertable] attribute directly on your model class.
113
121
114
122
```csharp
@@ -134,14 +142,18 @@ public class DeviceReading
134
142
For convenient local development, a `docker-compose.yml` file is included in the **Solution Items**. This allows you to spin up a pre-configured TimescaleDB instance with a single command.
135
143
136
144
### Start TimescaleDB container
145
+
137
146
From the solution root, run:
147
+
138
148
```bash
139
149
docker-compose up -d
140
150
```
141
151
142
-
### Resetting the Database Environment
152
+
### Resetting the Database Environment
153
+
143
154
If you need to start with a completely fresh, empty database, you can stop the running container and permanently delete all of its data.
144
155
> **Warning**: This command is destructive and will erase all tables and data stored in your local TimescaleDB instance.
156
+
145
157
```bash
146
158
docker-compose down -v
147
159
```
@@ -209,15 +221,19 @@ Results are generated in `StrykerOutput/reports/mutation-report.html`. See `STRY
209
221
---
210
222
211
223
## 🛠️ Scripts
224
+
212
225
This repository includes PowerShell scripts to streamline the development workflow, particularly for switching between local project development and package-based testing.
213
226
214
227
### Allow PowerShell Scripts to Run
228
+
215
229
To run these scripts, you may first need to change the execution policy for the current process:
230
+
216
231
```powershell
217
232
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
218
233
```
219
234
220
235
### Switch Project/Package References
236
+
221
237
These script modify your `.csproj` files to switch between referencing the core libraries as direct project or as local NuGet packages.
222
238
223
239
Switch to **project references** (ideal for active development):
@@ -235,6 +251,7 @@ Switch to **NuGet package references** (to simulate a real-world consumer):
235
251
---
236
252
237
253
## 📦 Publish Local NuGet Package
254
+
238
255
To build and publish the core libraries to a local NuGet feed for testing, use the central publishing script. Note that this also done automatically by the `.\SwitchToPackageReferences.ps1` script.
0 commit comments