标签: sqlite

python 3.5更新sqlite3版本

我已经在 Windows 机器上安装了 python 3.5.3。我通过命令 sqlite3.sqlite_version 检查 SQLite 版本。它是版本3.8.11。

我的问题是如何将 SQLite 版本更新到 3.26?我不确定是否有第三方库或者我是否需要更新 sqlite3 库。

谢谢。

python sqlite

1
推荐指数
1
解决办法
1325
查看次数

错误:在任何源中都找不到 sqlite3-1.4.0

我目前正在尝试运行 run.rb 文件,但我不断收到 sqlite3 的错误。当我输入 时bundle install,我收到此成功消息:

Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.4
Using i18n 1.5.3
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using activemodel 5.2.2
Using arel 9.0.0
Using activerecord 5.2.2
Using bundler 2.0.1
Using coderay 1.1.2
Using equatable 0.5.0
Using method_source 0.9.2
Using mustermann 1.0.3
Using necromancer 0.4.0
Using tty-color 0.4.3
Using pastel 0.7.2
Using pry 0.12.2
Using rack 2.0.6
Using rack-protection 2.0.5
Using …
Run Code Online (Sandbox Code Playgroud)

ruby sqlite rubygems sinatra bundler

1
推荐指数
1
解决办法
1万
查看次数

适用于 .net Core/Standard 的 SQLite 库:MS EF 还是 sqlite.org?

我无法概述与 .Net Core 和/或 Standard 一起使用的不同 SQLite 库。看来主要有两个:

MS 库完全独立于 sqlite.org 的库吗?如果是的话,建议使用哪一种?我更喜欢简单性......如果使用 sqlite.org,我似乎只需要两个 dll。

sqlite system.data.sqlite .net-core .net-standard .net-standard-2.0

1
推荐指数
1
解决办法
1841
查看次数

Sqlite 中的临时表可用多长时间?

在我的 Android 应用程序中,我创建了一个临时表来对其进行一些连接。

db.execSQL("CREATE TEMPORARY TABLE pair (a INTEGER, b INTEGER);")
Run Code Online (Sandbox Code Playgroud)

你能告诉我它的可用时间是多久吗?看来,如果我重新启动应用程序,它就会消失,但如果不重新启动,它似乎会在数据库中,但会持续多长时间?

我在文档中发现它是在临时数据库中创建的。

如果“CREATE”和“TABLE”之间出现“TEMP”或“TEMPORARY”关键字,则将在临时数据库中创建新表。

sqlite android

1
推荐指数
1
解决办法
1009
查看次数

从单独的文件 Flask SQLAlchemy python3 访问数据库

我正在编写一个烧瓶应用程序。我有两个文件。main.py 和databases.py。我想从database.py 文件创建一个数据库。main.py 应访问databases.py 文件并创建名为“Users”的数据库和表。但它显示导入错误。帮我解决这个问题

主要.py

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from databases import User

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/data_log.db'
db = SQLAlchemy(app)

if __name__ == '__main__':
    db.create_all()
    app.run(host='0.0.0.0', port=5001)  
Run Code Online (Sandbox Code Playgroud)

数据库.py

from main import db
from passlib.apps import custom_app_context as pwd_context

class User(db.Model) :
    __tablename__ = 'users'
    user_id     =   db.Column(db.Integer, primary_key = True)
    username    =   db.Column(db.String(32), index = True)
    password    =   db.Column(db.String(128))
    def hash_password(self, password) :
        self.password =pwd_context.hash(password)
    def verify_password(self, password) :
        return pwd_context.verify(password, self.password)
Run Code Online (Sandbox Code Playgroud)

追溯: …

python sqlite flask python-3.x flask-sqlalchemy

1
推荐指数
1
解决办法
3200
查看次数

如何在 Xamarin.Forms 中使用 SQLite-net-plc 中的“.OrderBy”?

我想对保存在 SQLite 数据库中的日历条目进行排序,以便在列表视图中显示它们。如何使用 SQLite-net-plc 订购它们?

我以为我可以写:.OrderBy<CalendarEntryStartDate>但它不起作用,我尝试使用 SQLite 命令,但在使用它们时遇到了一些麻烦,因为我对 m.db 感到困惑。

using System;
using SQLite;

namespace Stundenplan.Models
{
    public class CalendarEntry
    {
        [PrimaryKey, AutoIncrement]
        public int CalendarEntryId { get; set; }
        public string CalendarEntryTitle { get; set; }
        public string CalendarEntryDescription { get; set; }
        [Column("StatDate")]
        public DateTime CalendarEntryStartDate { get; set; }
        public DateTime CalendarEntryEndDate { get; set; }
        public TimeSpan CalendarEntrySpan { get; set; }
        public string CalendarEntryParticipants { get; set; }
        public string CalendarEntrytLocation { get; …
Run Code Online (Sandbox Code Playgroud)

c# sqlite xamarin.forms sqlite-net-pcl

1
推荐指数
1
解决办法
2517
查看次数

如何使用自己的功能扩展sqlite3连接对象?

我有一个用 Python 2.7 编写的项目,其中主程序需要频繁访问 sqlite3 数据库以写入日志、测量结果、获取设置等。

目前我有一个 db 模块,其中包含 add_log()、get_setting() 等函数,其中的每个函数基本上如下所示:

def add_log(logtext):
    try:
        db = sqlite3.connect(database_location)
    except sqlite3.DatabaseError as e:
        db.close()  # try to gracefully close the db
        return("ERROR (ADD_LOG): While opening db: {}".format(e))
    try:
        with db:  # using context manager to automatically commit or roll back changes.
            # when using the context manager, the execute function of the db should be used instead of the cursor
            db.execute("insert into logs(level, source, log) values (?, ?, ?)", (level, source, logtext)) …
Run Code Online (Sandbox Code Playgroud)

python sqlite python-2.7

1
推荐指数
1
解决办法
2321
查看次数

如何保护 Android 中的 SQLITE 数据库?

目前我正在开发一个Android应用程序,它存储用户的重要数据,例如密码,卡号,网站用户名和密码等。我决定使用SQLITE DB,以便用户的数据可以驻留在他们自己的手机中,并且我计划实施 AES-256 算法 (SQLCiper),以便使用密钥对数据进行加密。但我担心的是它能发挥多大作用,如果有人进行逆向工程或 root 会发生什么?

请帮助我弄清楚这一点。

提前致谢。

sqlite android sqlcipher android-sqlite android-studio

1
推荐指数
1
解决办法
1598
查看次数

数据库错误:“NullPointerException:尝试在空对象引用上调用虚拟方法 getApplicationInfo()...”

我正在构建一个简单的多活动列表应用程序来练习 SQLite。我试图从数据库中获取字符串以在listview启动时显示。我收到错误

\n\n
\n

java.lang.NullPointerException:尝试在空对象引用上调用虚拟方法 \'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()\'

\n
\n\n

这是代码

\n\n
public class MainActivity extends AppCompatActivity {\n    SharedPreferences sharedPreferences;\n    ArrayList<String> listItem;\n    ArrayAdapter adapter;\n    ListView lv = (ListView) findViewById(R.id.list_view);\n    DatabaseHelper db = new DatabaseHelper(this);\n    Context context;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        Toolbar toolbar = findViewById(R.id.toolbar);\n        setSupportActionBar(toolbar);\n        listItem = new ArrayList<>();\n        viewData();\n        context = this;\n\n        FloatingActionButton fab = findViewById(R.id.fab);\n        fab.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                startActivity(new Intent(MainActivity.this, textInput.class));\n            }\n        });\n    }\n\n    // cast from …
Run Code Online (Sandbox Code Playgroud)

java database sqlite android listview

1
推荐指数
1
解决办法
8402
查看次数

如何在 SQLite(Javascript)中执行 LIKE 查询,同时将搜索词作为参数传递

我正在使用 React Native 并正在查询 SQLite 数据库。

我希望执行类似的查询,并将搜索词指定为参数。

下面的内容与 ? 配合得很好 符号。

SELECT * from People WHERE Name = ?
Run Code Online (Sandbox Code Playgroud)

这不起作用或我尝试过的任何类似变体:

SELECT * from People WHERE Name LIKE '%?%' 
Run Code Online (Sandbox Code Playgroud)

有人知道如何正确执行此操作吗?请不要对 SQL 注入提出任何插值或建议。

javascript sqlite react-native

1
推荐指数
1
解决办法
701
查看次数