supabase-community / postgrest-csharp

A C# Client library for Postgrest
https://supabase-community.github.io/postgrest-csharp/api/Postgrest.html
MIT License
114 stars 22 forks source link

Feat : Bulk insert #14

Closed elrhomariyounes closed 3 years ago

elrhomariyounes commented 3 years ago

What kind of change does this PR introduce?

Feature bulk insert

What is the current behavior?

Feature request #13

What is the new behavior?

Additional context

Usage

var client = Client.Instance.Initialize(baseUrl, new ClientAuthorization(AuthorizationType.Open, null));
var rocketUser = new User
            {
                Username = "rocket",
                AgeRange = new Range(35, 40),
                Status = "ONLINE"
            };

var aceUser = new User
            {
                Username = "ace",
                AgeRange = new Range(21, 28),
                Status = "OFFLINE"
            };
var users = new List<User>
            {
               rocketUser,
               aceUser
            };

var response = await client.Table<User>().Insert(users);
acupofjose commented 3 years ago

LOVE this! Thanks @elrhomariyounes!