kexiImport proposal - piggz (www.piggz.co.uk) ============================================= This is a proposal for some import functionality for kexi. As of this moment i have no idea how it will work, but ive been thinking and figured i should get something down in writing. Hopefully you will all improve on this and we can get something working. The way i see it we need to do a few things: 1) A common api to different import systems This would be similar in concept to kexidb drivers, but would only provide limited, specific functionality 2) DB specific classes that provide import functionality for postgres, mysql firebird etc... For 1) we need to to: i) Connect to backend -| | ii) Get list of databases | All this is already catered for in | kexidb iii) Get list of tables -| iv) For a given table, get list of columns as stringlist v) For a given table/column combination, get extended information for that column: type +--If a known kexi type then ok +--If unknown then driver may be able to automagically map to suitable type +--Ask the user what to do (map to type, convert column, drop column) index (yes/no) pkex (yes/no) default value Alot of this is already catered for in old kexi api, so maybe some chunks fo code could be reused, though a bit of a rewrite is inevitable to limit the functionality to the above Once the table/column information is available then a tableschema object would be created and standard kexidb api could create nescessary structure. For this there would be 2 modes of operation A) Structure will be created under new db name, and kexidb api would be used as normal B) Structure will be created in existing db. Kexi api would need a mode where kexi__* structure is created, but tables are not created as they already exist Ideas, suggestions and designs welcome :o) PiggZ