stripe-archive / mosql

MongoDB → PostgreSQL streaming replication
MIT License
1.62k stars 224 forks source link

Collections with names having "." in them #44

Closed goutamdan closed 10 years ago

goutamdan commented 10 years ago

If a collection has a name like ss.country we get the "No mapping for namespace" exception. Is this a bug or there is a way to work with such collection names?

Example stack trace is as follows. My mongo db is test and collection name is ss.country.

DEBUG MoSQL: No mapping for ns: test.ss.country /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/schema.rb:120:in find_ns!': No mapping for namespace: test.ss.country (MoSQL::SchemaError) from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/schema.rb:255:intable_for_ns' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/sql.rb:25:in table_for_ns' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/streamer.rb:116:inimport_collection' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/streamer.rb:102:in block (2 levels) in initial_import' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/streamer.rb:100:ineach' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/streamer.rb:100:in block in initial_import' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/streamer.rb:96:ineach' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/streamer.rb:96:in initial_import' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/streamer.rb:28:inimport' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/cli.rb:158:in run' from /usr/local/Cellar/ruby/2.1.2/lib/ruby/gems/2.1.0/gems/mosql-0.3.1/lib/mosql/cli.rb:16:inrun' from /Users/goutamdan/ruby_test/mosql-master/bin/mosql:5:in <top (required)>' from -e:1:inload' from -e:1:in `

'

nelhage commented 10 years ago

@goutamdan Can you your database against b1a9eda? That fixes the most obvious issue, but I haven't done an end-to-end test yet.