官术网_书友最值得收藏!

Storing and Retrieving Data

A typical need of any software application is to input/output data by reading/writing data files or data streams or by querying/manipulating a database. Regarding files and streams, unstructured data, or even binary data, is hard to manipulate, and so they are not recommended.

Also, proprietary data formats are not recommended because of the vendor lock-in risk, and so only standard data formats should be used. Fortunately, there are free Rust libraries that come to the rescue in these situations. There are Rust crates available to manipulate some of the most popular file formats, such as TOML, JSON, and XML.

In terms of databases, there are Rust crates to manipulate data using some of the most popular databases, such as SQLite, PostgreSQL, and Redis.

In this chapter, you will learn about the following:

  • How to read configuration data from a TOML file
  • How to read or write a JSON data file
  • How to read an XML data file
  • How to query or manipulate data in a SQLite database
  • How to query or manipulate data in a PostgreSQL database
  • How to query or manipulate data in a Redis database
主站蜘蛛池模板: 襄樊市| 上虞市| 福清市| 杨浦区| 阿克| 锦屏县| 若羌县| 老河口市| 克拉玛依市| 鸡泽县| 思南县| 勐海县| 长垣县| 湖南省| 沁水县| 保定市| 扎兰屯市| 张家港市| 沙田区| 鄢陵县| 广东省| 清镇市| 车险| 东安县| 宁陕县| 蕲春县| 阿拉尔市| 九寨沟县| 乾安县| 丹江口市| 雷州市| 宜昌市| 富阳市| 东宁县| 五大连池市| 嘉鱼县| 庐江县| 东乌珠穆沁旗| 长白| 宜宾市| 瓦房店市|