Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a SQLite database based on an XSD Data Set

People also ask

How can I create database tables from XSD files?

Open the XSD file added by double-clicking. Go to the toolbar and look Conversion. They select Create structure database from XML schema. Selects the data source.

Does SQLite support schema?

Always NULL. SQLite doesn't support schemas. The path to the database file specified in the connection string.

Can we create database in SQLite?

To create a new database in SQLite you need to specify databases when opening SQLite, or open an existing file using . open . You can use the . database command to see a list of existing databases.


I suspect in the general case this is hard; XML Schema allows for some quite bizarre type constructions. I'm not sure how you would do substitution groups, or extensions to restrictions of types for example.

However it should be possible to knock something together quite quickly (especially mapping from the classes in System.Xml.Schema) that works for 90% of schemas (i.e. sequence and choice elements with a few simple data types).


Perhaps you could use an XSL transformation to convert the XSD into SQL table definitions. Likewise, I can't find any prior examples of this, but I'd have thought it would be possible.

I'd imagine a generic XSLT for XSD->SQL, once written, could be applied to any such scenario (and would be cross-platform too). Perhaps somebody has done this before...


I'm sure you could write a small app that takes an XSD file and parses it into a SQL script. I've never seen code out there to do it though, but that's not saying it doesn't exist.