PulseTrade.MarketData.Storage.SqlServer 0.1.0-alpha8

This is a prerelease version of PulseTrade.MarketData.Storage.SqlServer.
dotnet add package PulseTrade.MarketData.Storage.SqlServer --version 0.1.0-alpha8
                    
NuGet\Install-Package PulseTrade.MarketData.Storage.SqlServer -Version 0.1.0-alpha8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PulseTrade.MarketData.Storage.SqlServer" Version="0.1.0-alpha8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PulseTrade.MarketData.Storage.SqlServer" Version="0.1.0-alpha8" />
                    
Directory.Packages.props
<PackageReference Include="PulseTrade.MarketData.Storage.SqlServer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PulseTrade.MarketData.Storage.SqlServer --version 0.1.0-alpha8
                    
#r "nuget: PulseTrade.MarketData.Storage.SqlServer, 0.1.0-alpha8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PulseTrade.MarketData.Storage.SqlServer@0.1.0-alpha8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PulseTrade.MarketData.Storage.SqlServer&version=0.1.0-alpha8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PulseTrade.MarketData.Storage.SqlServer&version=0.1.0-alpha8&prerelease
                    
Install as a Cake Tool

PulseTrade.MarketData.Storage.SqlServer

PTMD TAResearch的SQL Server serving provider。它只保存OHLCV projection、correction與checkpoint,不保存raw tick,也不取代MarketDataEvent/Direct PCSL2/KHistory truth。

Security

  • production只接受RSA encrypted connection-string file與explicit private-key path。
  • 不讀環境變數、不接受明文connection string command-line argument、不記錄解密內容。
  • encrypted file相容ptc.rsa-encrypted-text.v1 chunked format與既有single-chunk PKCS#1 format。

Migration

let settings =
    TaResearchSqlSettings.defaults encryptedConnectionStringPath privateKeyPath

let status =
    TaResearchMigration.applyEncryptedAsync settings cancellationToken

Migration只在connection string指定的database建立白名單schema、SchemaVersionInstrumentOhlcvOhlcvCorrectionProjectionCheckpointDataRevision sequence。schema v2為correction加入unique RequestId;既有row以legacy-<CorrectionId>回填。schema v3加入canonical trading-day seek index。它不建立、切換或刪除database。

Projection sink

let sink: IKHistoryProjectionSink =
    TaResearchSqlProjection.create settings

let! result = sink.AppendAsync envelope cancellationToken

row與checkpoint在同一serializable transaction commit後才回Inserted/Updated/Duplicate。invalid envelope、revision regression、sealed downgrade、SQL timeout或constraint failure都不得advance checkpoint;delivery consumer只能在CheckpointAdvanced=true且呼叫成功後confirm。

Query provider

let provider: ITaResearchQueryProvider =
    TaResearchSqlQuery.create settings

let windowProvider: ITaResearchWindowQueryProvider =
    TaResearchSqlQuery.createWindow settings

let! page = provider.QueryRangeAsync query cancellationToken
let! delta = provider.QueryDeltaAsync deltaQuery cancellationToken
let! latest = windowProvider.QueryLatestAsync latestQuery cancellationToken
let! tradingDay = windowProvider.QueryTradingDayAsync tradingDayQuery cancellationToken

range query使用InstrumentId + IntervalCode + OpenTimeUtc keyset seek;cursor綁instrument/interval且不可跨query重用。latest使用同natural key反向seek後恢復ascending order;trading-day直接查stored canonical day,不由caller猜timezone。effective rows以latest correction決定:non-void overlay base row,void回復base row;兩者都以CorrectionRevision推進effective data revision,確保delta能觀察修正與撤銷。query回bounded rows、coverage gaps、revision、watermark/freshness、cursor與HasMore,不使用OFFSET paging。

Correction store

let correctionStore: ITaResearchCorrectionStore =
    TaResearchSqlCorrection.create settings

let! result = correctionStore.AppendAsync command cancellationToken
let! audit = correctionStore.ListAuditAsync command.Key 100 cancellationToken

write在serializable transaction內驗證base row、effective OHLCV、same-key supersedes與global revision。same RequestIdDuplicate;跨key collision、invalid patch或missing base fail closed。audit是append-only;rebuild只改base Ohlcv,不覆寫correction history。

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on PulseTrade.MarketData.Storage.SqlServer:

Package Downloads
PulseTrade.MarketData.TAResearch.Host

Query-only HTTP host for PTMD TAResearch SQL serving store.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha8 83 7/12/2026
0.1.0-alpha7 193 7/12/2026