简体   繁体   English

Berkley gdbm通常如何使用?

[英]How is Berkley gdbm typically used?

Gdbm is a simple key – value storage. Gdbm是一个简单的键-值存储。 I suspect that its use is based on various tricks. 我怀疑它的使用基于各种技巧。 For example, from end-user perspective, I would like to have a record named user/project , that should have associated the following: 例如,从最终用户的角度来看,我想要一条名为user/project的记录,该记录应与以下内容相关联:

  • protocol, git:// or http:// 协议,git://或http://
  • domain like: github.com, bitbucket.com, etc. – forming url like github://user/project 像github.com,bitbucket.com之类的域–像github:// user / project一样形成网址
  • enabled / disabled 启用/禁用
  • method of loading – here 3 different methods like "native", "binary", "normal" 加载方法–这里有3种不同的方法,例如“ native”,“ binary”,“ normal”
  • main file – "main.c", or other 主文件–“ main.c”或其他
  • ignore files – say "&" separated string with file paths to ignore 忽略文件–用“&”分隔的字符串和文件路径忽略
  • depth – number of commits to download 深度–下载的提交次数

I think this is enough. 我认为这足够了。 What I mean is that real world uses are sophisticated and Gdbm doesn't seem to defend itself. 我的意思是,现实世界中的使用非常复杂,Gdbm似乎并没有为自己辩护。 Is there a way to apply its use for above scenario? 有没有办法将其用于上述情况?

Will this work? 这样行吗? GDBM uses hashes, and if you use MLDBM you can store hashes of hashes as references. GDBM使用哈希,如果使用MLDBM,则可​​以将哈希的哈希存储为引用。

%bobs_game_prj = { proto => git
  domain => blah.com
  ignore => \%ignore_files = { file1 => path, file2 => path}
  etc.}

I do something like this with perl, but I imagine it works in any programming language. 我用perl做类似的事情,但是我想它可以在任何编程语言中工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通常如何管理从远程数据库的加载? (从概念上) - How is loading from a remote database typically managed? (conceptually) 使用Berkley DB的dataSearch中出现错误 - error in dataSearch using berkley DB 您通常如何将数据从电子表格导入多个数据库列? - How do you typically import data from a spreadsheet to multiple database columns? 将任何哈希存储在GDBM中,我可以在其中搜索吗? - Store any hash in GDBM and can I search in it? GDBM与简单的JSON,INI或YAML配置文件 - GDBM vs a simple JSON, INI or YAML configuration file _gdbm.error: 数据库需要恢复——在获取 api 数据时存储空间不足 - _gdbm.error: Database needs recovery -- after running out of storage while fetching api data 通常仅在SQL Server 2012中插入的分区表 - Partitioning table that is typically only inserted to in SQL Server 2012 数据库管理系统通常会绕过文件系统是真的吗? - Is it true that database management systems typically bypass file systems..? Web服务的数据库通常位于哪里? - Where does a Web service's Database typically sit? 在MySQL中将如何使用继承? - How would inheritance be used in MySQL?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM