The CSV Datasource is a 'read-only' driver. That is, it cannot persist back to the source file. Your question is - how to persist the CSV data. One trick is to write a function to read the CSV data and then POST to an SQL table. The transformation may be a little tricky since the CSV datasource does not really distinguish the datatypes of the columns (e.g. Dates, Booleans, Strings, Numbers).
1) Create a Resource (normal table) for your CSV table.
2) Create a new Managed Server Datasource
In the Data Sources menu - click add and select Managed Data Server
3) Once you have a new Data Source - go to Schema and Add a new Table
Add Columns for each of your CSV columns (Note: The names must match the JSON exactly)
4) Create a new Function.
//This will return a JSON object view of your data
var myCSVData = SysUtility.getResource("MyCSVTableResource", null);
var resourceURL = req.getBaseUrl() + "v1/MyPersistentCSVTable";
var parms = {};
var apikey = "demo_full";// or req.apiKey.getApiKey();
var settings = { "headers": {"Authorization" : "CALiveAPICreator "+apikey+":1"}};
var postResponse = SysUtility.restPost(resourceURL, parms, settings, myCSVData);
log.debug(postResponse);
var jsonPost = JSON.parse(postResponse);
return jsonPost;
5) Go to rest lab and execute your Function
Your data is now in a persistent SQL Table.