Skip to content

Commit 046a0c6

Browse files
author
ducksoop
committed
docs(readme): update readme with examples
Add some examples of the insert, update, and delete commands in the readme.
1 parent ff2231e commit 046a0c6

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

README.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
## 📋 Overview
44

5-
QuickbaseNet is a versatile C# library designed to simplify and streamline interactions with the QuickBase API. <!-- Tailored for developers looking to efficiently perform CRUD operations and build complex queries, QuickbaseNet offers a set of intuitive tools including `QuickBaseCommandBuilder`, `QueryBuilder`, and `QuickbaseClient`. Whether you're managing database records or crafting detailed queries, QuickbaseNet enhances your experience with QuickBase tables through its fluent and user-friendly interfaces. -->
5+
QuickbaseNet is a versatile C# library designed to simplify and streamline interactions with the QuickBase API. Tailored for developers looking to efficiently perform CRUD operations and build complex queries, QuickbaseNet offers a set of intuitive tools including `QuickBaseCommandBuilder`, `QueryBuilder`, and `QuickbaseClient`. Whether you're managing database records or crafting detailed queries, QuickbaseNet enhances your experience with QuickBase tables through its fluent and user-friendly interfaces.
66

77
## ✨ Features
88

99
- **Fluent Interface 🌊**: Methods for building various requests easily and intuitively.
10-
<!-- - **Comprehensive CRUD Operations 🛠️**: `QuickBaseCommandBuilder` for adding new records, updating existing ones, or deleting records efficiently. -->
10+
- **Comprehensive CRUD Operations 🛠️**: `QuickBaseCommandBuilder` for adding new records, updating existing ones, or deleting records efficiently.
1111
- **Advanced Query Support 🔍**: `QueryBuilder` for constructing complex query requests with ease.
1212
- **Seamless Client Setup 🌐**: `QuickbaseClient` for initializing connections with realm and user token for secure and straightforward API interaction.
1313

@@ -33,46 +33,25 @@ QuickbaseNet simplifies working with the QuickBase API across various operations
3333
// Initialize QuickbaseClient with your realm hostname and user token
3434
var quickbaseClient = new QuickbaseClient("your_realm_hostname", "your_user_token");
3535
```
36-
37-
<!--
3836
### Handling API Responses 📬
3937

40-
#### Sending a Query Request
41-
42-
```csharp
43-
// Build a query using QueryBuilder
44-
var query = new QueryBuilder()
45-
.From("bck7gp3q2")
46-
.Select(1, 2, 3)
47-
.Where("{1.CT.'hello'}")
48-
.Build();
49-
50-
// Send the query and handle the response
51-
var (response, error, isSuccess) = await quickbaseClient.QueryRecords(query);
52-
53-
if (isSuccess)
54-
{
55-
// Process the successful response
56-
}
57-
else
58-
{
59-
// Handle the error
60-
}
61-
```
62-
6338
#### Inserting Records
6439

6540
```csharp
6641
// Configure and build an insert request using QuickBaseCommandBuilder
6742
var insertRequest = new QuickBaseCommandBuilder()
6843
.ForTable("your_table_id")
69-
// Add configuration for insert request...
70-
.BuildInsertOrUpdateRequest();
44+
.ReturnFields(1, 2, 3) // Specify which fields to return after the insert operation
45+
.AddNewRecord(record => record
46+
.AddField(6, "New record description") // Add data for field 6
47+
.AddField(7, 100) // Add data for field 7
48+
.AddField(9, "2024-02-13")) // Add data for field 9
49+
.BuildInsertUpdateCommand();
7150

7251
// Send the insert request and handle the response
73-
var (response, error, isSuccess) = await quickbaseClient.InsertRecords(insertRequest);
52+
var result = await quickbaseClient.InsertRecords(insertRequest);
7453

75-
if (isSuccess)
54+
if (result.IsSuccess)
7655
{
7756
// Handle successful insert response
7857
}
@@ -85,16 +64,19 @@ else
8564
#### Updating Records
8665

8766
```csharp
88-
// Configure and build an update request
67+
// Configure and build an update request using QuickBaseCommandBuilder
8968
var updateRequest = new QuickBaseCommandBuilder()
9069
.ForTable("your_table_id")
91-
// Add configuration for update request...
92-
.BuildInsertOrUpdateRequest();
70+
.ReturnFields(1, 2, 3) // Specify which fields to return after the update operation
71+
.UpdateRecord(8, record => record // Specify the record to update based on its record ID (8 in this example)
72+
.AddField(7, 150) // Update field 7 with a new value
73+
.AddField(9, "2024-02-15")) // Update field 9 with a new value
74+
.BuildInsertUpdateCommand();
9375

9476
// Send the update request and handle the response
95-
var (response, error, isSuccess) = await quickbaseClient.UpdateRecords(updateRequest);
77+
var result = await quickbaseClient.UpdateRecords(updateRequest);
9678

97-
if (isSuccess)
79+
if (result.IsSuccess)
9880
{
9981
// Handle successful update response
10082
}
@@ -111,13 +93,22 @@ else
11193
var deleteRequest = new QuickBaseCommandBuilder()
11294
.ForTable("your_table_id")
11395
.WithDeletionCriteria("{6.EX.'hello'}")
114-
.BuildDeleteRequest();
96+
.BuildDeleteCommand();
11597

11698
// Send the delete request and handle the response
117-
var response = await quickbaseClient.DeleteRecords(deleteRequest);
99+
var result = await quickbaseClient.DeleteRecords(deleteRequest);
100+
101+
if (result.IsSuccess)
102+
{
103+
// Handle successful delete response
104+
}
105+
else
106+
{
107+
// Process the error
108+
}
118109
```
119110
##
120-
-->
111+
121112
### QueryBuilder - Crafting Queries with Precision 🔎
122113

123114
#### Building and Sending a Query 📤
@@ -134,7 +125,16 @@ var query = new QueryBuilder()
134125
.Build();
135126

136127
// Send the query and handle the response
137-
var response = await quickbaseClient.QueryRecords(query);
128+
var result = await quickbaseClient.QueryRecords(query);
129+
130+
if (result.IsSuccess)
131+
{
132+
// Process successful response
133+
}
134+
else
135+
{
136+
// Handle error
137+
}
138138
```
139139

140140
## 👐 Contributing

0 commit comments

Comments
 (0)