Comments (6)
Hello @yasseralsaidi, I will try to help on the direction to take for your request :)
Yes, it is possible to accomplish this task, but not using the CSV export feature from @sadmann7.
Why? This would involve considering many different factors. For example, imagine you have a million rows with thousands of columns and many text fields; this would result in a very large file.
1. Long-running Task:
In my opinion, this should be handled as a background job. I would use Inngest for such a task. A background job is necessary because Vercel only runs for a limited amount of time, depending on your account plan and runtime setup.
2. File Size and Memory:
Generating a CSV file as a background task requires careful memory management. Although a CSV file is typically light, it can quickly become cumbersome depending on the volume of data to be exported. For this, I would stream the data to a file saved on Uploadthing.
3. Task Concurrency:
Depending on your setup (runtime, etc.), be aware that generating a file takes time and can slow down other users' requests. Again, Inngest would be key to addressing this issue.
Final Workflow:
- A user on your platform requests an export.
- You save the export request with filters and other data in your database.
- You start an Inngest flow to generate the file (Papaparse can help to generate the file).
- Inngest streams the data in chunks to Uploadthing to ensure data is not lost and memory limits are not exceeded.
- Once the full data set is sent to your file on Uploadthing, you send a notification through your platform or by email to the user with a link to the file located on Uploadthing.
Exporting data to CSV can be quite complex!
from shadcn-table.
Any Update on the feature?
from shadcn-table.
i will try to put together a demo of it in the weekend
from shadcn-table.
Hey any update?
from shadcn-table.
Thanks for suggesting the feature.
Wrote a function to export as csv.
<Button
variant="outline"
size="sm"
onClick={() =>
exportTableToCSV(table, {
filename: "tasks",
excludeColumns: ["select", "actions"],
})
}
>
<DownloadIcon className="mr-2 size-4" aria-hidden="true" />
Export
</Button>
from shadcn-table.
can we export all filterd data without to do page by page?
from shadcn-table.
Related Issues (20)
- floating bar doesn't float or stay at bottom-1 HOT 2
- Selection persists when pagination and/or filters change HOT 2
- Command block only responsive to keyboard HOT 3
- Sticky Header HOT 2
- Requesting Date Range filter with shadcn calender HOT 4
- how to use Global filter HOT 3
- what params to have full page display without pagination and scroll HOT 1
- [bug]: enableHiding and enableSorting not correctly reflected inside data-table-column-header HOT 1
- [feat]: filter boolean HOT 6
- [bug]: data in the update-sheet was incorrect after creating a new item
- [Bug] useDataTable: Allow schema parameter to override default createdAt sort HOT 1
- [bug]: Advanced Filter doesn't appear to work in demo HOT 2
- [feat]: Relations / references HOT 1
- [feat]: Grouping Support
- [bug]: Date range isn't persisted across reloads HOT 1
- [feat]: Determine per_page on container/viewport on load
- [bug]: Recent Date-Range fix is displaying the previous day instead of selected url date
- [bug]: https://table.sadmn.com/ 404 HOT 1
- [bug]: page empty HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shadcn-table.