agaitan026
agaitan026
Explore posts from servers
XXata
Created by agaitan026 on 7/30/2024 in #help
how to show all results in react app?
im trying const response = await axios.post( 'https://alexis-gaitan-s-workspace-r0aiag.us-east-1.xata.sh/db/dbsnetworkdb:main/tables/usuarios/query', but its showing only max 1000 results, but i have like 10000
7 replies
XXata
Created by agaitan026 on 6/15/2024 in #help
summarize columns linked table
"records": [
{
"id": "1",
"name": "MW305R Router Inalámbrico N de 300Mbps",
"product_references_in_variation_location_details": {
"records": [
{
"id": "1",
"qty_available": 11,
"xata": {
"createdAt": "2024-05-24T16:27:22.855691+00:00",
"updatedAt": "2024-06-15T13:38:55.614973+00:00",
"version": 1
}
},
{
"id": "6",
"qty_available": 5,
"xata": {
"createdAt": "2024-05-24T16:27:22.855691+00:00",
"updatedAt": "2024-06-15T13:39:09.60911+00:00",
"version": 1
}
}
]
},
"xata": {
"createdAt": "2024-05-24T16:26:48.597836Z",
"updatedAt": "2024-06-03T16:28:37.242412Z",
"version": 13
}
},
{
"id": "2",
"name": "MS105G Switch de escritorio de 5 puertos 10/100 / 1,000 Mbps",
"product_references_in_variation_location_details": {
"records": [
{
"id": "2",
"qty_available": 11,
"xata": {
"createdAt": "2024-05-24T16:27:22.855691+00:00",
"updatedAt": "2024-06-15T13:39:04.164232+00:00",
"version": 1
}
},
{
"id": "7",
"qty_available": 0,
"xata": {
"createdAt": "2024-05-24T16:27:22.855691+00:00",
"updatedAt": "2024-06-15T14:18:49.988908+00:00",
"version": 5
}
}
]
},
"xata": {
"createdAt": "2024-05-24T16:26:48.597836Z",
"updatedAt": "2024-06-03T16:29:08.960135Z",
"version": 11
}
}
]
}
"records": [
{
"id": "1",
"name": "MW305R Router Inalámbrico N de 300Mbps",
"product_references_in_variation_location_details": {
"records": [
{
"id": "1",
"qty_available": 11,
"xata": {
"createdAt": "2024-05-24T16:27:22.855691+00:00",
"updatedAt": "2024-06-15T13:38:55.614973+00:00",
"version": 1
}
},
{
"id": "6",
"qty_available": 5,
"xata": {
"createdAt": "2024-05-24T16:27:22.855691+00:00",
"updatedAt": "2024-06-15T13:39:09.60911+00:00",
"version": 1
}
}
]
},
"xata": {
"createdAt": "2024-05-24T16:26:48.597836Z",
"updatedAt": "2024-06-03T16:28:37.242412Z",
"version": 13
}
},
{
"id": "2",
"name": "MS105G Switch de escritorio de 5 puertos 10/100 / 1,000 Mbps",
"product_references_in_variation_location_details": {
"records": [
{
"id": "2",
"qty_available": 11,
"xata": {
"createdAt": "2024-05-24T16:27:22.855691+00:00",
"updatedAt": "2024-06-15T13:39:04.164232+00:00",
"version": 1
}
},
{
"id": "7",
"qty_available": 0,
"xata": {
"createdAt": "2024-05-24T16:27:22.855691+00:00",
"updatedAt": "2024-06-15T14:18:49.988908+00:00",
"version": 5
}
}
]
},
"xata": {
"createdAt": "2024-05-24T16:26:48.597836Z",
"updatedAt": "2024-06-03T16:29:08.960135Z",
"version": 11
}
}
]
}
i got the following response i need to sum up qty_available for each product, how i can do it?
5 replies
XXata
Created by agaitan026 on 6/8/2024 in #help
how i can link two table like this
No description
13 replies
XXata
Created by agaitan026 on 5/28/2024 in #help
inner join with rest api?
any change of do a inner join with rest api?
23 replies
XXata
Created by agaitan026 on 5/28/2024 in #help
Issues with summarize table api rest
hi summarize is not working it shows: { "message": "" }
5 replies
XXata
Created by agaitan026 on 5/27/2024 in #help
manage ilike in api?
theres any api method to search records like ILIKE ? or theres only LIKE available?
4 replies
CC#
Created by agaitan026 on 1/13/2024 in #help
issues loading winform with api rest
hi i got the following code:
using Json.Net;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Net.Http;
using Syncfusion.WinForms.DataGrid;

namespace SfDataGrid_REST_API
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
sfDataGrid1.DataSource = GetRESTData("http://45.237.184.122:4000/clientes?limit=10");
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "OrderID" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "CustomerID" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "EmployeeID" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "Freight" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "ShipCity" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "Verified" });
}

private JArray GetRESTData(string uri)
{
var webRequest = (HttpWebRequest)WebRequest.Create(uri);
var webResponse = (HttpWebResponse)webRequest.GetResponse();
var reader = new StreamReader(webResponse.GetResponseStream());
string data = reader.ReadToEnd();
return JsonConvert.DeserializeObject<JArray>(data);
}
}
}
using Json.Net;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Net.Http;
using Syncfusion.WinForms.DataGrid;

namespace SfDataGrid_REST_API
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
sfDataGrid1.DataSource = GetRESTData("http://45.237.184.122:4000/clientes?limit=10");
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "OrderID" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "CustomerID" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "EmployeeID" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "Freight" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "ShipCity" });
this.sfDataGrid1.Columns.Add(new GridTextColumn() { MappingName = "Verified" });
}

private JArray GetRESTData(string uri)
{
var webRequest = (HttpWebRequest)WebRequest.Create(uri);
var webResponse = (HttpWebResponse)webRequest.GetResponse();
var reader = new StreamReader(webResponse.GetResponseStream());
string data = reader.ReadToEnd();
return JsonConvert.DeserializeObject<JArray>(data);
}
}
}
but getting this: Newtonsoft.Json.JsonSerializationException: 'Deserialized JSON type 'Newtonsoft.Json.Linq.JObject' is not compatible with expected type 'Newtonsoft.Json.Linq.JArray'. Path '', line 1, position 9636.' what im missing?
20 replies
TTCTheo's Typesafe Cult
Created by agaitan026 on 6/19/2023 in #questions
use t3 to create a nextjs frontend and backend with nextjs to have login , create user with mysql?
any example to use t3 to create my app using nextjs as frontend and option to login, add new user, etc, i got all my info in a planetscale mysql db thank you
3 replies