In the previous post, we saw how to use cl-azure to access Azure storage, in particular, BLOBs. Today we will experiment with Tables.
The following operations are currently supported by the library:
– Create a new table
– List all the tables available
– Add rows to a table
– List the contents of a table
– Delete a table
The create-table function lets you create a table in your account. If you want to know what tables are available in the account, you can use the function query-tables.
There is a very useful application called Storage Explorer that you can use to connect to your account and manage the different entities. Here is a screenshot of the app showing the tables in my account:
Let us add two rows to the newly created table. The function insert-entity does this. Every table must have two mandatory columns called PartitionKey and RowKey. These are used as the primary keys. You can add other columns as needed. For this example, let us define additional columns Name and Age, and accordingly populate two entities in the table.
The corresponding view in the StorageExplorer is shown below.
The last operation we will try is the delete-table command. This will delete a table and all its contents.
If you refresh the StorageExplorer view at this time, you can see that there is no table in the account,
As noted earlier, the library is far from complete. Hope that the author will revisit it and complete it in the near future.
Recent Comments