I developed an application using cartodb.js, and I made a duplicate table/database to reference (and updated my table name, layer URL, and API key references in my code). With this new table, the app gives the following error when the layer is added to the map (after it displays the layer on the map – which surprised me): ”Uncaught Error: sql is read-only in NamedMaps”.
Previously I had been using a table and a visualization that had a “Only visible to people with the link” (orange lock icon) privacy setting for both. I was able to perform read queries (SELECT SQL statements) to the table/layer without the need for an API Key and had no errors returned. I only had to use my API Key when using INSERT, UPDATE, and DELETE SQL statements.
With the new table and visualization, I have the same privacy settings specified: “Only visible to people with the link”. But now, it gives the “Only visible to people with the link” error when I try to do a SELECT SQL query using
sublayers.setSQL( “SELECT …”).
- Shouldn’t I be able to do SELECT SQL queries with a visualization and its table set to a privacy setting of “Only visible to people with the link”?
- If I choose to make my table and/or visualization “Private” (red lock icon), I presume I can execute SQL queries using ` $.getJSON(“http://username.cartodb.com/api/v2/sql?q=SELECT...&api_key=12”)`. But, how do perform `sublayers.setSQL( “SELECT …”)` calls? (Wouldn't I need to include an API Key?)