Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
378 commits
Select commit Hold shift + click to select a range
41a5e80
Add legacy datetime support
NinoFloris Jul 10, 2023
caed1f1
No unsupported resolver exceptions during introspection
NinoFloris Jul 10, 2023
9defade
Fixes and a little lie about array types to appease the tests
NinoFloris Jul 10, 2023
6f48fe4
Add money converter
NinoFloris Jul 10, 2023
2d21c32
Add hstore converter
NinoFloris Jul 10, 2023
68b8ef9
Improve range converter
NinoFloris Jul 10, 2023
1784fc3
Rework buffer requirements
NinoFloris Jul 10, 2023
b16a601
Add json and jsonb textual reading/writing
NinoFloris Jul 10, 2023
3739fdc
Naming
NinoFloris Jul 10, 2023
1b1aedb
Implement NTS support
roji Jul 9, 2023
033a042
Fix extension check
NinoFloris Jul 9, 2023
594b2b8
Fix resolution
NinoFloris Jul 9, 2023
eeef6c8
Fix datatypename normalization from NpgsqlDbType
NinoFloris Jul 9, 2023
4e7a9ef
Remove dead code
NinoFloris Jul 9, 2023
5cdd9cc
Add arrays
roji Jul 10, 2023
47212f3
More ns2.0 fixes again
NinoFloris Jul 10, 2023
e2b5327
Check binary size difference
NinoFloris Jul 11, 2023
ec36756
Move abstract up and impl down
NinoFloris Jul 11, 2023
6bd7f38
Small fixes
NinoFloris Jul 11, 2023
5a531f8
Fix datatable crap
NinoFloris Jul 11, 2023
c31af72
Add more text types
NinoFloris Jul 11, 2023
934f11a
Multiranges
roji Jul 10, 2023
ec42026
Small fixes
NinoFloris Jul 11, 2023
dc649fe
Improve handling of sequential access cursor
NinoFloris Jul 11, 2023
8f4c1e0
Bounded column reads
NinoFloris Jul 17, 2023
4a1a5a3
Small fixes and TextReader support
NinoFloris Jul 18, 2023
2620fcf
Final changes on bounded reads
NinoFloris Jul 18, 2023
dccde14
Implement GetChars over TextReader
NinoFloris Jul 18, 2023
00b851a
Implement GetBytes
NinoFloris Jul 18, 2023
42ef1da
More test fixes
NinoFloris Jul 18, 2023
e874e77
Handle cancellation retry in Read/ReadAsync buffer stream methods
NinoFloris Jul 18, 2023
41b11e8
Netstandard fixes
NinoFloris Jul 18, 2023
5ed5262
Another iteration of bounded reads, automatically consume data for co…
NinoFloris Jul 18, 2023
1209ccc
Have nested data reader use nested reads as well
NinoFloris Jul 18, 2023
0f0ceea
Improve nested reader invalidation mechanism
NinoFloris Jul 18, 2023
7f6b349
Clarify rereading rules for sequential mode
NinoFloris Jul 18, 2023
aa7c6c1
Add back byte reading fast path
NinoFloris Jul 18, 2023
d382ff2
Implement ltree
roji Jul 18, 2023
6f96239
Change removed property
NinoFloris Jul 18, 2023
d92391d
Colocate sync/async reading
NinoFloris Jul 18, 2023
bca19cb
Small fixes after doing a review
NinoFloris Jul 19, 2023
1a87bb6
Complete some converter resolver todos
NinoFloris Jul 19, 2023
762812e
Remove test for a mapping that doesn't exist
NinoFloris Jul 19, 2023
d0484e2
Add timestamp(tz) range mappings
NinoFloris Jul 19, 2023
bf6fdb3
Add back jagged validation
NinoFloris Jul 19, 2023
17fdf8f
Breaking change, remove support for non generic list and derived List…
NinoFloris Jul 19, 2023
a3eb659
Add byte reading/writing of text and json
NinoFloris Jul 19, 2023
cf9857b
Remove roundtripping restrictions on certain bytea mappings
NinoFloris Jul 19, 2023
cd8a070
Add jsonpath support
NinoFloris Jul 19, 2023
721353a
Revert an invalid optimization
NinoFloris Jul 19, 2023
f939f64
Add missed array mappings
NinoFloris Jul 19, 2023
2140410
Add stream writing support to bytea
NinoFloris Jul 20, 2023
9870761
Cache parameter size
NinoFloris Jul 20, 2023
99523f5
Add multirange resolver
NinoFloris Jul 20, 2023
a1054c2
Small configurability additions to PgTypeInfo
NinoFloris Jul 20, 2023
d528029
Centralize type equality logic
NinoFloris Jul 20, 2023
6f8c917
Stream fix
NinoFloris Jul 20, 2023
460499c
Rationalize unboxing behavior, also opens up ability for arrays to be…
NinoFloris Jul 20, 2023
50baaa5
Change array converters to constrain to IList
NinoFloris Jul 20, 2023
51e4ae4
Add ts and tstzmultirange
NinoFloris Jul 20, 2023
7cf537f
Allow null return from converter resolver
NinoFloris Jul 20, 2023
a30c75f
Create specialized versions for all the different datetime resolver k…
NinoFloris Jul 23, 2023
e1212ec
And remove the composing resolvers
NinoFloris Jul 23, 2023
92cd1f0
Add accurate type names in datetime resolver exception
NinoFloris Jul 23, 2023
86a7a5f
Don't lose stacktrace on break if possible
NinoFloris Jul 23, 2023
8ed13f7
Add bitstring string writing
NinoFloris Jul 23, 2023
167c6d7
Resolve aot warning
NinoFloris Jul 23, 2023
24126f6
Handle a trim warning
NinoFloris Jul 23, 2023
0309892
Suppress DbDataReader.GetFieldType dynamically accessed members attri…
NinoFloris Jul 23, 2023
43c4eb8
Remove dead code, add comments and other small iterations
NinoFloris Jul 24, 2023
3a15e89
Bring back default name translator
NinoFloris Jul 24, 2023
d15949a
Add unmapped enums
NinoFloris Jul 24, 2023
0e89d7e
Add valuetuple and tuple records
NinoFloris Jul 24, 2023
8d6c05b
Bring truncate behavior back as a compat feature
NinoFloris Jul 25, 2023
00027fc
Rename method
NinoFloris Aug 4, 2023
1c40a1a
Cleanup
NinoFloris Aug 4, 2023
4c357d6
Package version bumps
NinoFloris Aug 4, 2023
f780b3b
Add STJ poco and known types support
NinoFloris Aug 4, 2023
38a61c1
Revert nonsense
NinoFloris Aug 4, 2023
43cd2c5
Fix typo
NinoFloris Aug 4, 2023
a15af2d
Improve introspection mode
NinoFloris Aug 8, 2023
50442ef
Make nested writes consistent with reads
NinoFloris Aug 8, 2023
874c407
Add composite type support
NinoFloris Aug 8, 2023
0703f94
Netstandard fixes
NinoFloris Aug 8, 2023
edae3f8
Add STJ arrays
NinoFloris Aug 8, 2023
a0be4e5
Move field description info cache to reader
NinoFloris Aug 12, 2023
f08ecd5
Fixes
NinoFloris Aug 12, 2023
1f16f5c
Add missed configure awaits
NinoFloris Aug 12, 2023
5ecbfed
Make datatypename have an implicit conversion to string
NinoFloris Aug 15, 2023
2960183
Fix nullable resolvers
NinoFloris Aug 15, 2023
4bbb22c
Improve jsondocument sizing somewhat until unknown sizing support is …
NinoFloris Aug 15, 2023
0763d02
Add GeoJSON support
NinoFloris Aug 17, 2023
87ae2c8
Small improvement
NinoFloris Aug 17, 2023
74065e6
Add Json.NET support
NinoFloris Aug 17, 2023
51bdb4d
Add comment
NinoFloris Aug 17, 2023
51f9304
Make PgConverterInfo and Bind internal
NinoFloris Aug 17, 2023
fd8e500
Implement boxed converter support in composites
NinoFloris Aug 17, 2023
d5b4a3e
Clean up PgTypeInfo api surface
NinoFloris Aug 17, 2023
bede1ec
Move delegating GetFieldValue calls to non-GVM GetFieldValueCore
NinoFloris Aug 17, 2023
90a8411
Fix benchmark project errors
NinoFloris Aug 17, 2023
f412a2c
Properly respect async flag on nested read disposal (and ConfigureAwa…
NinoFloris Aug 17, 2023
9c3deab
Remove an ensure overload
NinoFloris Aug 18, 2023
90df4b4
Add back some friendly errors on missing pg types
NinoFloris Aug 18, 2023
118ef5a
Fix cache bleed
NinoFloris Aug 18, 2023
e0fbf1f
Make type info cache code read better
NinoFloris Aug 18, 2023
b229db4
Make multirange mappings conditional on db support
NinoFloris Aug 18, 2023
2031ac7
Actually revert AttemptPostgresCancellation and friends after dispose…
NinoFloris Aug 18, 2023
d6e078a
Catch race during extension create
NinoFloris Aug 18, 2023
b25dbf3
Assert null cache
NinoFloris Aug 18, 2023
204b0d6
Remove dead reference
NinoFloris Aug 18, 2023
0384260
Root out more invalid or missing reader state transitions
NinoFloris Aug 19, 2023
93b2409
Fix writer ifdef issue
NinoFloris Aug 19, 2023
e0b9ea7
Fix double converter netstandard code
NinoFloris Aug 19, 2023
1b751f4
Fix json type info resolver being null
NinoFloris Aug 19, 2023
9338d48
Disable noda time tests for now
NinoFloris Aug 18, 2023
82ca73b
Segregate tests simulating errors to prevent unrelated test from fail…
NinoFloris Aug 20, 2023
43091df
Always reset read started
NinoFloris Aug 20, 2023
3f1bc3b
Readability improvements
NinoFloris Aug 20, 2023
5d5e98e
Centralize parameter info resets
NinoFloris Aug 20, 2023
0e261e3
Only reset binding info for size changes
NinoFloris Aug 20, 2023
5b19340
Improve PgTypeInfo api design
NinoFloris Aug 20, 2023
b6d8e3d
Try to prevent more multiplexing issues
NinoFloris Aug 20, 2023
9a0c5b3
Go over some TODOs
NinoFloris Aug 20, 2023
331f8e5
Add windows exemption to flaky test
NinoFloris Aug 20, 2023
1d60e9f
Reduce jsonb text converter bloat
NinoFloris Aug 20, 2023
043cd39
Rename
NinoFloris Aug 20, 2023
23317d5
Shorten BufferData{Async} to Buffer{Async}
NinoFloris Aug 20, 2023
85cca17
Improve nullable handling of sizes
NinoFloris Aug 20, 2023
bf7f339
Reduce the amount of types we reference
NinoFloris Aug 20, 2023
b6ac005
Create a dgml file to accompany the mstat
NinoFloris Aug 20, 2023
18093a2
Reduce bloat
NinoFloris Aug 21, 2023
87e8fa9
Small clarifications in abstractions
NinoFloris Aug 21, 2023
45b9c26
Move ImmutableDictionary mapping for hstore to extra conversions
NinoFloris Aug 21, 2023
ca63186
And move BigInteger too
NinoFloris Aug 21, 2023
47695e4
Properly remove all traces of ImmutableDictionary from hstore
NinoFloris Aug 21, 2023
6c4c2fa
Only reference if not trimmed
NinoFloris Aug 21, 2023
9d0c4fb
Fix typo
NinoFloris Aug 21, 2023
17d007c
Move out of array and match name instead
NinoFloris Aug 21, 2023
2fb590f
Typo
NinoFloris Aug 21, 2023
77dc1ac
Bump sdk version to preview 7
NinoFloris Aug 21, 2023
33cf9f0
Break away the last bits of PGUtil
NinoFloris Aug 22, 2023
8fb498c
Remove unused namespaces
NinoFloris Aug 22, 2023
3ccf9ab
Drop extension method
NinoFloris Aug 22, 2023
77e6bb0
Make ValueMetadata readonly
NinoFloris Aug 23, 2023
cfef2c8
Fix todo
NinoFloris Aug 23, 2023
217a922
Current fix
NinoFloris Aug 23, 2023
c457a19
Move unconsumed read error to endread
NinoFloris Aug 23, 2023
f56fe48
Sync binary exporter to patterns used in db data reader
NinoFloris Aug 23, 2023
e81d3b8
Enable all plugin tests and fix GeoJson errors
NinoFloris Aug 23, 2023
0dd1ab8
Fix infinite range bug
NinoFloris Aug 24, 2023
54488f4
Fix some exporter and replication value bugs
NinoFloris Aug 24, 2023
b82196a
Fix remaining nodatime plugin issues
NinoFloris Aug 24, 2023
26ead6d
Restructure range resolver to be more priority based
NinoFloris Aug 24, 2023
0745e8f
Add transaction for multiplexing to another test
NinoFloris Aug 24, 2023
9e57073
Don't make json types default for reading
NinoFloris Aug 24, 2023
204435b
Add net6.0 tfm to json.net to work around init prop issues
NinoFloris Aug 24, 2023
14a46c8
Allow type predicates to deny default matches
NinoFloris Aug 24, 2023
6d0de75
Fix remaining issues with Json.Net
NinoFloris Aug 24, 2023
cfbc1cb
Fix legacy infinite errors on NodaTime
NinoFloris Aug 24, 2023
f775827
Fix some incorrect null type predicate results
NinoFloris Aug 24, 2023
8f67b47
Reflect removal of silly read default from STJ poco resolver
NinoFloris Aug 24, 2023
03a8c18
Simplify infinity conversions again
NinoFloris Aug 24, 2023
48af381
Check pg dimension bound during array write
NinoFloris Aug 25, 2023
6b59118
Make range and multirange internal and add static factory instead
NinoFloris Aug 25, 2023
c5ec37b
Actually check length in all cases
NinoFloris Aug 25, 2023
193a175
Fix returned multirange type
NinoFloris Aug 25, 2023
288e57f
Normalize [] to _ in the constructor
NinoFloris Aug 25, 2023
d5d5d75
Fix compilation issue
NinoFloris Aug 25, 2023
b54be6a
Remove incorrect xmldoc
NinoFloris Aug 25, 2023
0dc144e
Improve composite type info error message
NinoFloris Aug 25, 2023
b968616
Move out some classes
NinoFloris Aug 25, 2023
dea71d7
Rename
NinoFloris Aug 25, 2023
71670e4
Speed up representational type resolution
NinoFloris Aug 25, 2023
7d9caf2
Add missed representational type resolutions
NinoFloris Aug 25, 2023
d065dc1
Bring back dev build tfm for Json.Net
NinoFloris Aug 25, 2023
0cf7c7e
Small naming and error message improvements
NinoFloris Aug 25, 2023
bae11dd
Make ColumnStream rely on cumulative position for consume during dispose
NinoFloris Aug 27, 2023
716b9ec
Improve PgReader Init/Commit StartRead/EndRead code
NinoFloris Aug 27, 2023
a89f2b0
Remove _readStarted entirely now we have EndRead doing the consumed c…
NinoFloris Aug 27, 2023
23a8eb9
More readability improvements
NinoFloris Aug 27, 2023
b93006b
Merge version byte prefixed text converter
NinoFloris Aug 28, 2023
c860836
Merge Hstore Read and ReadInto
NinoFloris Aug 28, 2023
5286ddc
Move some exceptions to resources
NinoFloris Aug 28, 2023
1e719af
Fast path other read bytes methods
NinoFloris Aug 28, 2023
2b84085
Monomorphize byte array converter
NinoFloris Aug 28, 2023
aa1d35e
Streamline field read infra
NinoFloris Aug 28, 2023
8c2c98a
Simplify cleanup
NinoFloris Aug 28, 2023
cfa7bfd
Fix boxing for default converters
NinoFloris Aug 28, 2023
87de21f
Speed up GetInfo and GetFieldValueCore
NinoFloris Aug 29, 2023
45aa8e0
Add info cache set and load for prepared statements
NinoFloris Aug 29, 2023
2b0cfe3
Speed up reader start/stop init/commit
NinoFloris Aug 29, 2023
ef6c763
Speed up primitive reads
NinoFloris Aug 29, 2023
0ca9eb7
Improve message
NinoFloris Aug 30, 2023
966b93f
Remove unused fields
NinoFloris Aug 30, 2023
68c0610
Small speedup
NinoFloris Aug 31, 2023
802b1e0
Improve encapsulation of NpgsqlParameter
NinoFloris Aug 30, 2023
c6f7afd
More parameter streamlining
NinoFloris Aug 30, 2023
5bedd08
Small readability improvements
NinoFloris Aug 31, 2023
70b5b03
Improve MultiWriteState state clearing behavior
NinoFloris Sep 1, 2023
eaa3a4d
Centralize async helper read logic
NinoFloris Sep 1, 2023
24eb65f
Add some missed buffer checks
NinoFloris Sep 5, 2023
85229cd
Remove redundant code
NinoFloris Sep 6, 2023
8d9719c
Map streaming onto SizeKind.Unknown instead of Size.Zero to make Buff…
NinoFloris Sep 5, 2023
bd2543a
Clarify bufferRequirements' applicability and fix nullable to adhere …
NinoFloris Sep 5, 2023
e607bef
Reader naming and structure improvements
NinoFloris Sep 6, 2023
60cd814
Fix seek to column in GetFieldValueAsync
NinoFloris Sep 6, 2023
8621153
Address nits
NinoFloris Sep 14, 2023
e9832ab
Make sure boxing infos use GetResolutionAsObject
NinoFloris Sep 15, 2023
5db9e65
Rework parameter ValueType code
NinoFloris Sep 15, 2023
d5038e6
Reset type info on Value changes for typeof(object) generic parameters
NinoFloris Sep 15, 2023
4f82171
Address more nits
NinoFloris Sep 15, 2023
1d70d65
Upgrade to RC1
NinoFloris Sep 18, 2023
8444895
Fix a default type fallback issue in the cache lookup
NinoFloris Sep 18, 2023
0de762c
Add array type checks
roji Sep 13, 2023
8e19205
Fix some more mappings and tests
NinoFloris Sep 15, 2023
61a8f78
Fix the remaining array mapping issues
NinoFloris Sep 18, 2023
4347682
Fix ensure issue and move PgWriter property to a method
NinoFloris Sep 18, 2023
10e11be
Use full version
NinoFloris Sep 18, 2023
97bf97a
Remove nightly feed
NinoFloris Sep 18, 2023
097c478
Add pragma for new ref readonly warnings
NinoFloris Sep 18, 2023
374c5d7
Fix nodatime array/multirange mapping tests
NinoFloris Sep 18, 2023
f77f484
Fix small bug in Json.NET synthetic mappings
NinoFloris Sep 18, 2023
18a3fb2
Make multirange asserts conditional
NinoFloris Sep 18, 2023
97d97bf
Fix debug build issues
NinoFloris Sep 18, 2023
2bf2b48
Change PgReader 'not exactly consumed' exception and behavior
NinoFloris Sep 18, 2023
a5a14b7
Replace debug only exception
NinoFloris Sep 18, 2023
32b4d75
Tidy up all dynamic mapping code
NinoFloris Sep 19, 2023
13cb873
Implement unmapped ranges
NinoFloris Sep 19, 2023
75cc6a1
Small tweaks
NinoFloris Sep 19, 2023
7112c13
Don't rely on 'current' data inside GetBytes/GetData
NinoFloris Sep 19, 2023
1950d0b
Fix SequentialAccess IsDbNull (resumable) + Get... (some non-resumabl…
NinoFloris Sep 19, 2023
db8a1db
Use DateTimeKind.Unspecified and assert on it in tests
NinoFloris Sep 20, 2023
c46c923
Address nits
NinoFloris Sep 20, 2023
960ab27
Use new big endian support in Guid
NinoFloris Sep 20, 2023
0810f5f
Add constants for states in BinaryExporter
NinoFloris Sep 20, 2023
8d2a713
Add support for unmapped multiranges
NinoFloris Sep 20, 2023
559a987
Don't try to get an object converter for type = null
NinoFloris Sep 20, 2023
3eb5257
Rename TypeCatalog to DatabaseInfo
NinoFloris Sep 20, 2023
07d05ba
Use IsAtStart in PgBufferedConverter
NinoFloris Sep 20, 2023
e02f40d
Add missed constant uses
NinoFloris Sep 21, 2023
a18e427
Actually implement IDisposable...
NinoFloris Sep 22, 2023
945ad65
Address feedback
NinoFloris Sep 21, 2023
9a4e731
Add resolvers check in GlobalTypeMapper (#15)
roji Sep 23, 2023
f244c63
Address feedback
NinoFloris Sep 24, 2023
403bc15
Breaking change, move refcursor and jsonpath to DbType.Object
NinoFloris Sep 24, 2023
b81e7a4
Rework NotSupportedException back to InvalidCastException to align to…
NinoFloris Sep 25, 2023
346386a
Make GetPostgresTypeXYZ/GetPgType overloads of GetPostgresType
NinoFloris Sep 25, 2023
f8fcd35
Message tweak
NinoFloris Sep 25, 2023
7fd17f7
Improve GetConcreteResolution
NinoFloris Sep 25, 2023
2841b54
Make jsonpath test conditional
NinoFloris Sep 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:
npgsql-dev:
# Source for tags: https://mcr.microsoft.com/v2/dotnet/sdk/tags/list
image: mcr.microsoft.com/dotnet/sdk:8.0.100-preview.6
image: mcr.microsoft.com/dotnet/sdk:8.0.100-preview.7
volumes:
- ..:/workspace:cached
tty: true
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
cancel-in-progress: true

env:
dotnet_sdk_version: '8.0.100-preview.6.23330.14'
dotnet_sdk_version: '8.0.100-rc.1.23463.5'
postgis_version: 3
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Windows comes with PG pre-installed, and defines the PGPASSWORD environment variable. Remove it as it interferes
Expand Down Expand Up @@ -315,7 +315,6 @@ jobs:
run: |
if [ -z "${{ matrix.pg_prerelease }}" ]; then
dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} test/Npgsql.PluginTests --logger "GitHubActions;report-warnings=false"
dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} test/Npgsql.NodaTime.Tests --logger "GitHubActions;report-warnings=false"
fi
shell: bash

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ concurrency:
cancel-in-progress: true

env:
dotnet_sdk_version: '8.0.100-preview.6.23330.14'
dotnet_sdk_version: '8.0.100-rc.1.23463.5'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

jobs:
Expand Down
67 changes: 41 additions & 26 deletions .github/workflows/native-aot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,32 @@ concurrency:
cancel-in-progress: true

env:
dotnet_sdk_version: '8.0.100-preview.6.23330.14'
dotnet_sdk_version: '8.0.100-rc.1.23463.5'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
nuget_config: |
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
</packageSources>

<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet8">
<package pattern="runtime.*" />
<package pattern="Microsoft.NETCore.App.Runtime.*" />
<package pattern="Microsoft.AspNetCore.App.Runtime.*" />
<package pattern="Microsoft.NET.ILLink.Tasks" />
<package pattern="Microsoft.DotNet.ILCompiler" />
</packageSource>
</packageSourceMapping>

</configuration>
# Uncomment and edit the following to use nightly/preview builds
# nuget_config: |
# <?xml version="1.0" encoding="utf-8"?>
# <configuration>
#
# <packageSources>
# <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
# <add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
# </packageSources>
#
# <packageSourceMapping>
# <packageSource key="nuget.org">
# <package pattern="*" />
# </packageSource>
# <packageSource key="dotnet8">
# <package pattern="runtime.*" />
# <package pattern="Microsoft.NETCore.App.Runtime.*" />
# <package pattern="Microsoft.AspNetCore.App.Runtime.*" />
# <package pattern="Microsoft.NET.ILLink.Tasks" />
# <package pattern="Microsoft.DotNet.ILCompiler" />
# </packageSource>
# </packageSourceMapping>
#
# </configuration>
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -68,8 +69,8 @@ jobs:
dotnet-version: |
${{ env.dotnet_sdk_version }}

- name: Setup nuget config
run: echo "$nuget_config" > NuGet.config
# - name: Setup nuget config
# run: echo "$nuget_config" > NuGet.config

- name: Setup Native AOT prerequisites
run: sudo apt-get install clang zlib1g-dev
Expand Down Expand Up @@ -108,6 +109,20 @@ jobs:
path: "test/Npgsql.NativeAotTests/obj/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests.mstat"
retention-days: 3

- name: Upload codedgen dgml
uses: actions/upload-artifact@v3.1.2
with:
name: npgsql.codegen.dgml.xml
path: "test/Npgsql.NativeAotTests/obj/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests.codegen.dgml.xml"
retention-days: 3

- name: Upload scan dgml
uses: actions/upload-artifact@v3.1.2
with:
name: npgsql.scan.dgml.xml
path: "test/Npgsql.NativeAotTests/obj/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests.scan.dgml.xml"
retention-days: 3

- name: Assert binary size
run: |
size="$(ls -l test/Npgsql.NativeAotTests/bin/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests | cut -d ' ' -f 5)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rich-code-nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- '*'

env:
dotnet_sdk_version: '8.0.100-preview.6.23330.14'
dotnet_sdk_version: '8.0.100-rc.1.23463.5'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

jobs:
Expand Down
53 changes: 25 additions & 28 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,35 +1,48 @@
<Project>
<PropertyGroup>
<SystemVersion>8.0.0-rc.1.23419.4</SystemVersion>
<ExtensionsVersion>$(SystemVersion)</ExtensionsVersion>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />

<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(ExtensionsVersion)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(ExtensionsVersion)" />
<PackageVersion Include="OpenTelemetry.API" Version="1.6.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />

<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Scriban.Signed" Version="5.9.0 " />
<!-- Compatibility -->
<PackageVersion Include="System.Threading.Channels" Version="$(SystemVersion)" />
<PackageVersion Include="System.Collections.Immutable" Version="$(SystemVersion)" />
<PackageVersion Include="System.Text.Json" Version="$(SystemVersion)" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(SystemVersion) " />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />

<!-- Plugins -->
<!-- Plugin projects -->
<PackageVersion Include="NetTopologySuite" Version="2.5.0" />
<PackageVersion Include="NetTopologySuite.IO.PostGIS" Version="2.1.0" />
<PackageVersion Include="NodaTime" Version="3.1.9" />
<PackageVersion Include="GeoJSON.Net" Version="1.2.19" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />

<!-- Build -->
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Scriban.Signed" Version="5.9.0 " />

<!-- Tests -->
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(ExtensionsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(ExtensionsVersion)" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="xunit" Version="2.5.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageVersion Include="AdoNet.Specification.Tests" Version="2.0.0-alpha8" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(ExtensionsVersion)" />

<!-- Benchmarks -->
<PackageVersion Include="BenchmarkDotNet" Version="0.13.8" />
Expand All @@ -39,20 +52,4 @@
<!-- NativeAOT -->
<PackageVersion Include="Mono.Cecil" Version="0.11.5" />
</ItemGroup>

<!-- Compatibility -->
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' ">
<PackageVersion Include="System.Text.Json" Version="7.0.3" />
<PackageVersion Include="System.Threading.Channels" Version="7.0.0" />
<PackageVersion Include="System.Collections.Immutable" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net6.0' ">
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="7.0.2" />
</ItemGroup>
</Project>
11 changes: 0 additions & 11 deletions Npgsql.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Npgsql.SourceGenerators", "src\Npgsql.SourceGenerators\Npgsql.SourceGenerators.csproj", "{63026A19-60B8-4906-81CB-216F30E8094B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Npgsql.NodaTime.Tests", "test\Npgsql.NodaTime.Tests\Npgsql.NodaTime.Tests.csproj", "{C00D2EB1-5719-4372-9E1C-5ED05DC23A00}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Npgsql.OpenTelemetry", "src\Npgsql.OpenTelemetry\Npgsql.OpenTelemetry.csproj", "{DA29F063-1828-47D8-B051-800AF7C9A0BE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Github", "Github", "{BA7B6F53-D24D-45AC-927A-266857EA8D1E}"
Expand Down Expand Up @@ -144,14 +142,6 @@ Global
{63026A19-60B8-4906-81CB-216F30E8094B}.Release|Any CPU.Build.0 = Release|Any CPU
{63026A19-60B8-4906-81CB-216F30E8094B}.Release|x86.ActiveCfg = Release|Any CPU
{63026A19-60B8-4906-81CB-216F30E8094B}.Release|x86.Build.0 = Release|Any CPU
{C00D2EB1-5719-4372-9E1C-5ED05DC23A00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C00D2EB1-5719-4372-9E1C-5ED05DC23A00}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C00D2EB1-5719-4372-9E1C-5ED05DC23A00}.Debug|x86.ActiveCfg = Debug|Any CPU
{C00D2EB1-5719-4372-9E1C-5ED05DC23A00}.Debug|x86.Build.0 = Debug|Any CPU
{C00D2EB1-5719-4372-9E1C-5ED05DC23A00}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C00D2EB1-5719-4372-9E1C-5ED05DC23A00}.Release|Any CPU.Build.0 = Release|Any CPU
{C00D2EB1-5719-4372-9E1C-5ED05DC23A00}.Release|x86.ActiveCfg = Release|Any CPU
{C00D2EB1-5719-4372-9E1C-5ED05DC23A00}.Release|x86.Build.0 = Release|Any CPU
{DA29F063-1828-47D8-B051-800AF7C9A0BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA29F063-1828-47D8-B051-800AF7C9A0BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA29F063-1828-47D8-B051-800AF7C9A0BE}.Debug|x86.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -199,7 +189,6 @@ Global
{F7C53EBD-0075-474F-A083-419257D04080} = {8537E50E-CF7F-49CB-B4EF-3E2A1B11F050}
{A77E5FAF-D775-4AB4-8846-8965C2104E60} = {ED612DB1-AB32-4603-95E7-891BACA71C39}
{63026A19-60B8-4906-81CB-216F30E8094B} = {8537E50E-CF7F-49CB-B4EF-3E2A1B11F050}
{C00D2EB1-5719-4372-9E1C-5ED05DC23A00} = {ED612DB1-AB32-4603-95E7-891BACA71C39}
{DA29F063-1828-47D8-B051-800AF7C9A0BE} = {8537E50E-CF7F-49CB-B4EF-3E2A1B11F050}
{BA7B6F53-D24D-45AC-927A-266857EA8D1E} = {004A2E0F-D34A-44D4-8DF0-D2BC63B57073}
{B58E12EB-E43D-4D77-894E-5157D2269836} = {8537E50E-CF7F-49CB-B4EF-3E2A1B11F050}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Npgsql.GeoJSON.Internal;
namespace Npgsql.GeoJSON;

readonly partial struct CrsMap
public partial class CrsMap
{
/// <summary>
/// These entries came from spatial_res_sys. They are used to elide memory allocations
Expand Down Expand Up @@ -586,4 +586,4 @@ readonly partial struct CrsMap
new(32766, 32766, "EPSG"),
new(900913, 900913, "spatialreferencing.org"),
};
}
}
59 changes: 59 additions & 0 deletions src/Npgsql.GeoJSON/CrsMap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

namespace Npgsql.GeoJSON;

/// <summary>
/// A map of entries that map the authority to the inclusive range of SRID.
/// </summary>
public partial class CrsMap
{
readonly CrsMapEntry[]? _overriden;

internal CrsMap(CrsMapEntry[]? overriden)
=> _overriden = overriden;

internal string? GetAuthority(int srid)
=> GetAuthority(_overriden, srid) ?? GetAuthority(WellKnown, srid);

static string? GetAuthority(CrsMapEntry[]? entries, int srid)
{
if (entries == null)
return null;

var left = 0;
var right = entries.Length;
while (left <= right)
{
var middle = left + (right - left) / 2;
var entry = entries[middle];

if (srid < entry.MinSrid)
right = middle - 1;
else
if (srid > entry.MaxSrid)
left = middle + 1;
else
return entry.Authority;
}

return null;
}
}

/// <summary>
/// An entry which maps the authority to the inclusive range of SRID.
/// </summary>
readonly struct CrsMapEntry
{
internal readonly int MinSrid;
internal readonly int MaxSrid;
internal readonly string? Authority;

internal CrsMapEntry(int minSrid, int maxSrid, string? authority)
{
MinSrid = minSrid;
MaxSrid = maxSrid;
Authority = authority != null
? string.IsInterned(authority) ?? authority
: null;
}
}
50 changes: 50 additions & 0 deletions src/Npgsql.GeoJSON/CrsMapExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System.Threading.Tasks;
using Npgsql.GeoJSON.Internal;

namespace Npgsql.GeoJSON;

/// <summary>
/// Extensions for getting a CrsMap from a database.
/// </summary>
public static class CrsMapExtensions
{
/// <summary>
/// Gets the full crs details from the database.
/// </summary>
/// <param name="dataSource"></param>
public static async Task<CrsMap> GetCrsMapAsync(this NpgsqlDataSource dataSource)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put these as static Load() methods on CrsMap rather than as extensions of NpgsqlDataSource?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly better yeah, though they do need a using at least

{
var builder = new CrsMapBuilder();
using var cmd = GetCsrCommand(dataSource);
await using var reader = await cmd.ExecuteReaderAsync();

while (await reader.ReadAsync())
builder.Add(new CrsMapEntry(reader.GetInt32(0), reader.GetInt32(1), reader.GetString(2)));

return builder.Build();
}

/// <summary>
/// Gets the full crs details from the database.
/// </summary>
/// <param name="dataSource"></param>
public static CrsMap GetCrsMap(this NpgsqlDataSource dataSource)
{
var builder = new CrsMapBuilder();
using var cmd = GetCsrCommand(dataSource);
using var reader = cmd.ExecuteReader();

while (reader.Read())
builder.Add(new CrsMapEntry(reader.GetInt32(0), reader.GetInt32(1), reader.GetString(2)));

return builder.Build();
}

static NpgsqlCommand GetCsrCommand(NpgsqlDataSource dataSource)
=> dataSource.CreateCommand("""
SELECT min(srid), max(srid), auth_name
FROM(SELECT srid, auth_name, srid - rank() OVER(PARTITION BY auth_name ORDER BY srid) AS range FROM spatial_ref_sys) AS s
GROUP BY range, auth_name
ORDER BY 1;
""");
}
Loading