sqlite

C# SQLite Insert Datetime type Value

徘徊边缘 提交于 2021-02-17 07:09:25
问题 I want Insert DateTime Type Value.But I got this Error Source Code private void Execute(string query) { SQLiteCommand cmd = new SQLiteCommand(query, conn); int result = cmd.ExecuteNonQuery(); Debug("Executed query: {0} Result: {1}", query, result); } private string DEscape(DateTime time) { return time.ToString(@"\'yyyy-MM-dd\'"); } public void InsertVideo(string videoID, DateTime releaseDate, string[] genres) { string genreStr = ""; foreach (string g in genres) { genreStr = genreStr +

Tweepy to sqlite3

亡梦爱人 提交于 2021-02-17 06:59:07
问题 I'm trying to use Twitter's Streaming API to save tweets to a database using sqlite3. The problem is my database comes back empty. I'm using DB Browser for SQLIte to check the schema and the table and columns are there but no values for any column. Any thoughts? #create sql table conn = sqlite3.connect('twitter_one5.db') c = conn.cursor() c.execute('''CREATE TABLE tweets (coordinates integer, place text)''') conn.commit() conn.close() # open connection conn = sqlite3.connect('twitter_one5.db'

Delphi Firedac not recognizing new ALTER feature in sqlite3

风流意气都作罢 提交于 2021-02-17 06:25:09
问题 SQLite3 release 3.25 and higher allows me to "ALTER TABLE myTable RENAME COLUMN oldColName TO newColName" . But I get an error "near RENAME" when I execute this in my Delphi code, but it works running the new sqlite3.dll from the command line or with another utility. This works: HerdConnection.ExecSQL('ALTER TABLE myTable RENAME TO NewNameTable'); This fails: HerdConnection.ExecSQL('ALTER TABLE myTable RENAME COLUMN oldcolName TO NewColName'); Since i installed the new sqlite3.dll driver, the

SQLite-Net Extensions - GetAllWithChildrenAsync not pulling everything

杀马特。学长 韩版系。学妹 提交于 2021-02-17 06:10:12
问题 I am trying to use SQLite-Net Extensions to create a Relational Database. I'm running into an issue when trying to pull the Term object from the database. It successfully pulls over its associated courses, but not the courses associated assessments and notes. I'm not sure if the problem lies in how I insert the objects into the database, how I pull the objects from the database, or how I have the objects attributes listed. I feel like the SQLite-Net Extensions documentation is extremely

Get Distinct Entries Based On Specific Column in Entity Framework

感情迁移 提交于 2021-02-17 05:57:21
问题 I have a SQLite table that contains every test result we've run, and I'm looking to write an entity framework query that returns only the most recent test result per project. Normally, I'd assume this would be "group by project id, return row with the max updated value," or, alternatively, "sort by date and return first". However, when I try the query, I keep getting Entity Framework "could not be translated" errors. Here's what I've tried: results = await _context.Results .Include(x => x

Get Distinct Entries Based On Specific Column in Entity Framework

只愿长相守 提交于 2021-02-17 05:57:08
问题 I have a SQLite table that contains every test result we've run, and I'm looking to write an entity framework query that returns only the most recent test result per project. Normally, I'd assume this would be "group by project id, return row with the max updated value," or, alternatively, "sort by date and return first". However, when I try the query, I keep getting Entity Framework "could not be translated" errors. Here's what I've tried: results = await _context.Results .Include(x => x

sql injection in sqlite full text search

偶尔善良 提交于 2021-02-16 20:46:11
问题 consider sqlite3 fts4 table c.execute("CREATE VIRTUAL TABLE docs USING fts4(content)") Is the following safe from sql injection where txt contains a string? I am not sure if parameterised query is safe or not,since there is only one parameter txt which is a string. c.execute("SELECT * FROM docs WHERE docs MATCH (?)",(txt,)) 回答1: Yes, it is safe from SQL injection; that is what the SQL parameter is for , to escape and quote txt properly. If you were to use string formatting ( "... MATCH ('%s')

How to use SQLAlchemy to create a full text search index on SQLite and query it?

我是研究僧i 提交于 2021-02-16 13:40:26
问题 I am create a simple app which can performance basic operations. SQLite is used as database. I want to perform wildcard search but I know that it has poor performance. I want to try out full text search but I cannot full a example on how to do it. I confirmed that SQLite has full text search support. Here is my sample code. from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class Person(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text, unique=True,

How to use SQLAlchemy to create a full text search index on SQLite and query it?

被刻印的时光 ゝ 提交于 2021-02-16 13:40:09
问题 I am create a simple app which can performance basic operations. SQLite is used as database. I want to perform wildcard search but I know that it has poor performance. I want to try out full text search but I cannot full a example on how to do it. I confirmed that SQLite has full text search support. Here is my sample code. from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class Person(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text, unique=True,

centos 编译python3.7.0 报错ModuleNotFoundError: No module named '_ctypes'

时光毁灭记忆、已成空白 提交于 2021-02-15 19:29:54
平台:CentOS7 先安装以下依赖 yum -y groupinstall "Development tools" yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel yum install libffi-devel -y make install 来源: oschina 链接: https://my.oschina.net/u/2654135/blog/3074409