twmht / python-rocksdb

Python bindings for RocksDB
BSD 3-Clause "New" or "Revised" License
276 stars 88 forks source link

Column Family Support #35

Closed fried closed 5 years ago

fried commented 6 years ago

Any operation that handles keys can also handle column families by accepting a tuple(ColumnFamilyHandle, key) any operation that returns keys when used with ColumnFamilies will return them in the same way.

fried commented 6 years ago

I inadvertently included the fix for StringAppendOperator to work for python3.

twmht commented 6 years ago

@fried

thank you. The review is ongoing.

hwind commented 5 years ago

When will this PR be merged? I'm looking forward :)

ingvarbiz commented 5 years ago

Can you please proceed with that PR? Column Family support will help me a lot in my current project. Thank you!

iFA88 commented 5 years ago

Can you give some tutorial, how can be open an existing database which has column families? I get rocksdb.errors.InvalidArgument: Invalid argument: You have to open all column families. Column families not opened: ...... when i want to open my database.

Thank you!

UPDATE

I have got this! You need create a dict from the column family name and his options like:

cfs = { "default":rocksdb.ColumnFamilyOptions(), "cf_1":rocksdb.ColumnFamilyOptions() }

and you can open the database:

db = rocksdb.DB(path, opts, column_families=cfs)