datasets-br / sql-unifier

Try all datasets in a single SQL table, plug-and-play!
3 stars 0 forks source link

Adopt an integer hash of the namespace name as its ns_id #14

Closed ppKrauss closed 6 years ago

ppKrauss commented 6 years ago

As proposed and implemented after issue #7 with namespace control, the automatic SQL-View names and other automatic labels can use the ns_id. So a view of the dataset named "abcd_ok" in a namespace named "xptoabc" (ns_id=3) will be "vw3_abcd" instead a longo and confuse name with namespace name (eg. "vw_xptoabc_abcd_ok".

Little problem... For tutorials and user-projects, that changes de datasets and namespace, but back with same names, ideal is to preserve when possible the correspondense name-ID (namespace name with namespace ns_id).

The solution is a hash, an integer (1 or 2 digits) hash obtained from the SHA1 of the name... It looks complex but I can reuse some libraries...