草庐IT

db_constraint

全部标签

sqlite - 击中 sqlalchemy.exc.IntegrityError : (IntegrityError) constraint failed 'INSERT INTO users

我正在使用sqlite数据库并且我在这个要点中声明了模型https://gist.github.com/mmahesh/7245561我添加了一个带有事务管理器的模型实例作为withtransaction.manager:model=Users(username='example',name='Example',email_primary='m@m.com',_password='example')DBSession.add(model)每当我执行initialize_sample_dbdevelopment.ini时,都会出现此错误sqlalchemy.exc.IntegrityEr

sqlite - 击中 sqlalchemy.exc.IntegrityError : (IntegrityError) constraint failed 'INSERT INTO users

我正在使用sqlite数据库并且我在这个要点中声明了模型https://gist.github.com/mmahesh/7245561我添加了一个带有事务管理器的模型实例作为withtransaction.manager:model=Users(username='example',name='Example',email_primary='m@m.com',_password='example')DBSession.add(model)每当我执行initialize_sample_dbdevelopment.ini时,都会出现此错误sqlalchemy.exc.IntegrityEr

qt - 如何使用 Windows/MinGW 平台为带有 SQLCipher 扩展的 SQLite-DB 构建 Qt-SQL-driver-plugin 'QSQLCIPHER'?

这通常不是在哪里可以找到分步指南的问题,而是指南本身的问题。我写这篇文章的目的是给其他人一个提示,他们在编译驱动程序插件时遇到了和我最近一样的问题。如何使用Windows/MinGW平台使用SQLCipher-extension为SQLite-DB构建Qt-SQL-driver-plugin'QSQLCIPHER'? 最佳答案 如何使用Windows/MinGW平台为带有SQLCipher扩展的SQLite-DB构建Qt-SQL-driver-plugin'QSQLCIPHER':适用于Windows/MinGW的Qt5.4.0下载

qt - 如何使用 Windows/MinGW 平台为带有 SQLCipher 扩展的 SQLite-DB 构建 Qt-SQL-driver-plugin 'QSQLCIPHER'?

这通常不是在哪里可以找到分步指南的问题,而是指南本身的问题。我写这篇文章的目的是给其他人一个提示,他们在编译驱动程序插件时遇到了和我最近一样的问题。如何使用Windows/MinGW平台使用SQLCipher-extension为SQLite-DB构建Qt-SQL-driver-plugin'QSQLCIPHER'? 最佳答案 如何使用Windows/MinGW平台为带有SQLCipher扩展的SQLite-DB构建Qt-SQL-driver-plugin'QSQLCIPHER':适用于Windows/MinGW的Qt5.4.0下载

sqlite - 我们怎么知道sqlite DB的锁状态呢?

1)是否有编译指示或任何方式知道当前lockstatesqlite数据库?2)此外,有没有办法知道是否有任何其他进程正在使用数据库? 最佳答案 没有编译指示,但是FAQ状态:WhenSQLitetriestoaccessafilethatislockedbyanotherprocess,thedefaultbehavioristoreturnSQLITE_BUSY.但是,这仅意味着数据库被锁定为写入,而不是读取。 关于sqlite-我们怎么知道sqliteDB的锁状态呢?,我们在Stac

sqlite - 我们怎么知道sqlite DB的锁状态呢?

1)是否有编译指示或任何方式知道当前lockstatesqlite数据库?2)此外,有没有办法知道是否有任何其他进程正在使用数据库? 最佳答案 没有编译指示,但是FAQ状态:WhenSQLitetriestoaccessafilethatislockedbyanotherprocess,thedefaultbehavioristoreturnSQLITE_BUSY.但是,这仅意味着数据库被锁定为写入,而不是读取。 关于sqlite-我们怎么知道sqliteDB的锁状态呢?,我们在Stac

python - 将 python sqlite db 转换为 hdf5

PandasDataFrame可以像这样转换为hdf5文件;df.to_hdf('test_store.hdf','test',mode='w')我有一个sqlitedb文件,必须将其转换为hdf5文件,然后我会使用pd.read_hdf通过pandas读取hdf5文件。但首先如何将pythonsqlite数据库转换为hdf5文件?编辑:我知道在pandas中使用.read_sql方法。但我想先将db转换为hdf5。 最佳答案 这非常简单:使用pandas!Pandas支持readingdatadirectlyfromaSQLdat

python - 将 python sqlite db 转换为 hdf5

PandasDataFrame可以像这样转换为hdf5文件;df.to_hdf('test_store.hdf','test',mode='w')我有一个sqlitedb文件,必须将其转换为hdf5文件,然后我会使用pd.read_hdf通过pandas读取hdf5文件。但首先如何将pythonsqlite数据库转换为hdf5文件?编辑:我知道在pandas中使用.read_sql方法。但我想先将db转换为hdf5。 最佳答案 这非常简单:使用pandas!Pandas支持readingdatadirectlyfromaSQLdat

python - Django 2.0 : sqlite IntegrityError: FOREIGN KEY constraint failed

我正在努力为django-pagetree添加Django2.0支持图书馆。在自动化测试期间,使用sqlite内存数据库,我遇到了一堆这样的错误:File"/home/nnyby/src/django-pagetree/pagetree/tests/test_models.py",line638,insetUp'children':[],File"/home/nnyby/src/django-pagetree/pagetree/models.py",line586,inadd_child_section_from_dict...File"/home/nnyby/src/django-p

python - Django 2.0 : sqlite IntegrityError: FOREIGN KEY constraint failed

我正在努力为django-pagetree添加Django2.0支持图书馆。在自动化测试期间,使用sqlite内存数据库,我遇到了一堆这样的错误:File"/home/nnyby/src/django-pagetree/pagetree/tests/test_models.py",line638,insetUp'children':[],File"/home/nnyby/src/django-pagetree/pagetree/models.py",line586,inadd_child_section_from_dict...File"/home/nnyby/src/django-p