diff --git a/benchmark/UUID.Benchmarks/DatabaseOptimizationBenchmarks.cs b/benchmark/UUID.Benchmarks/DatabaseOptimizationBenchmarks.cs index 872d0b6..49efe2c 100644 --- a/benchmark/UUID.Benchmarks/DatabaseOptimizationBenchmarks.cs +++ b/benchmark/UUID.Benchmarks/DatabaseOptimizationBenchmarks.cs @@ -25,13 +25,13 @@ public UUID GenerateRandomV4() [Benchmark] public UUID GeneratePostgreSQLOptimized() { - return UUID.NewDatabaseFriendly(DatabaseType.PostgreSQL); + return UUID.NewDatabaseOptimized(DatabaseType.PostgreSQL); } [Benchmark] public UUID GenerateSQLServerOptimized() { - return UUID.NewDatabaseFriendly(DatabaseType.SQLServer); + return UUID.NewDatabaseOptimized(DatabaseType.SQLServer); } [Benchmark] diff --git a/demo/UUID.Demo/Program.cs b/demo/UUID.Demo/Program.cs index 5b8e5e7..3ff0a86 100644 --- a/demo/UUID.Demo/Program.cs +++ b/demo/UUID.Demo/Program.cs @@ -226,7 +226,7 @@ static async Task Main(string[] args) Console.WriteLine("\n13. Database-Specific UUID Generation:"); Console.WriteLine("PostgreSQL Optimized (V7):"); - UUID postgresUUID = UUID.NewDatabaseFriendly(DatabaseType.PostgreSQL); + UUID postgresUUID = UUID.NewDatabaseOptimized(DatabaseType.PostgreSQL); Console.WriteLine($"UUID: {postgresUUID}"); Console.WriteLine($"Version: {Decoder.GetVersionDescription(postgresUUID)}"); @@ -234,7 +234,7 @@ static async Task Main(string[] args) Console.WriteLine("\nSQL Server Optimized (V8):"); - UUID sqlServerUUID = UUID.NewDatabaseFriendly(DatabaseType.SQLServer); + UUID sqlServerUUID = UUID.NewDatabaseOptimized(DatabaseType.SQLServer); Console.WriteLine($"UUID: {sqlServerUUID}"); Console.WriteLine($"Version: {Decoder.GetVersionDescription(sqlServerUUID)}"); diff --git a/src/UUID/Tools/Toolkit.cs b/src/UUID/Tools/Toolkit.cs index 73ba74a..d629cdc 100644 --- a/src/UUID/Tools/Toolkit.cs +++ b/src/UUID/Tools/Toolkit.cs @@ -118,7 +118,7 @@ public static UUID[] CreateSequentialBatch(int count, DatabaseType dbType = Data for (int i = 0; i < count; i++) { - result[i] = UUID.NewDatabaseFriendly(dbType); + result[i] = UUID.NewDatabaseOptimized(dbType); } return result; diff --git a/src/UUID/Versions/Version.cs b/src/UUID/Versions/Version.cs index 2132702..acc2529 100644 --- a/src/UUID/Versions/Version.cs +++ b/src/UUID/Versions/Version.cs @@ -6,7 +6,7 @@ namespace System public readonly partial struct UUID { /// - /// Creates a new database-friendly UUID optimized for the specified database type. + /// Creates a new database UUID optimized for the specified database type. /// /// The type of database where the UUID will be stored. /// A new UUID instance optimized for the specified database. @@ -17,7 +17,7 @@ public readonly partial struct UUID /// - SQLite: Uses Version 7 (same as PostgreSQL) /// - Other databases: Uses Version 4 (random) as default /// - public static UUID NewDatabaseFriendly(DatabaseType dbType) + public static UUID NewDatabaseOptimized(DatabaseType dbType) { return dbType switch { diff --git a/test/UUID.Tests/DatabaseOptimizationTests.cs b/test/UUID.Tests/DatabaseOptimizationTests.cs index ba030e0..ef18e71 100644 --- a/test/UUID.Tests/DatabaseOptimizationTests.cs +++ b/test/UUID.Tests/DatabaseOptimizationTests.cs @@ -10,7 +10,7 @@ public class DatabaseOptimizationTests public void PostgreSQL_Optimized_UUID_Should_Be_Version7() { // Arrange & Act - UUID uuid = UUID.NewDatabaseFriendly(DatabaseType.PostgreSQL); + UUID uuid = UUID.NewDatabaseOptimized(DatabaseType.PostgreSQL); // Assert Assert.Equal(7, uuid.Version); @@ -21,7 +21,7 @@ public void PostgreSQL_Optimized_UUID_Should_Be_Version7() public void SQLServer_Optimized_UUID_Should_Be_Version8() { // Arrange & Act - UUID uuid = UUID.NewDatabaseFriendly(DatabaseType.SQLServer); + UUID uuid = UUID.NewDatabaseOptimized(DatabaseType.SQLServer); // Assert Assert.Equal(8, uuid.Version); @@ -52,7 +52,7 @@ public void Sequential_Batch_Should_Maintain_Time_Order() public void Database_Friendly_UUIDs_Should_Have_Valid_Sequence(DatabaseType dbType) { // Arrange & Act - UUID uuid = UUID.NewDatabaseFriendly(dbType); + UUID uuid = UUID.NewDatabaseOptimized(dbType); // Assert Assert.True(Decoder.TryGetSequence(uuid, out ushort sequence),