问题描述
我的问题:有人在SQLite中转换SQL文件的超级简单方法吗?
My question: has someone a super-easy way to convert a SQL-file in SQLite?
推荐答案
好吧,现在更加清楚了:您想获取一个现有的MySQL文件并将其转换为与SQL Lite等效的文件.
Okay, now it's a little clearer: You want to take an existing MySQL file and translate it into its SQL Lite equivalent.
此过程分为两部分:
- 将DDL从一个SQL数据库转换为另一个(DDL ==数据定义语言")
- 将数据从一种模式迁移到另一种模式.
每个SQL供应商都以ANSI SQL开头,并添加了自己的专有语法.因此,您必须根据MySQL定义创建一个SQL Lite模式(表,列,索引等).
Every SQL vendor starts with ANSI SQL and adds in their own proprietary syntax. So you'll have to create a SQL Lite schema (tables, columns, indexes, etc) from the MySQL definition.
数据迁移过程称为ETL(提取-转换-加载").您可能必须对MySQL中的某些数据进行处理,才能将其导入SQL Lite.
The data migration process is called ETL ("Extract-Transform-Load"). You might have to massage some of that data from MySQL to get it into SQL Lite.
最好的方案是将MySQL数据导出到.csv文件,在SQL Lite中创建表,然后导入.csv文件.
The best scenario would be to export your MySQL data into a .csv file, create the table in SQL Lite, then import the .csv file.
这篇关于将SQL轻松转换为SQLite?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!