並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 50件

新着順 人気順

sqlite insert into using selectの検索結果1 - 40 件 / 50件

  • 新しいNext.jsの入門 ─ App DirectoryによるWeb開発をハンズオンで理解しよう|ハイクラス転職・求人情報サイト アンビ(AMBI)

    使用するライブラリ このアプリで、Next.js以外に使用するライブラリは以下の4つです。インストール方法等は必要な箇所で説明します。 Prisma TypeScriptのORマッパーです。アプリでのノートの保存等に使用します。 ▶ Prisma | Next-generation ORM for Node.js & TypeScript Tailwind CSS CSSフレームワークです。アプリのUIデザインに使用します。 ▶ Tailwind CSS - Rapidly build modern websites without ever leaving your HTML. Zod バリデーションライブラリです。APIレスポンスの型定義とバリデーションに使用します。 ▶ Zod | Documentation SWR データフェッチ用のライブラリです。ノート一覧のクライアントサイドで

      新しいNext.jsの入門 ─ App DirectoryによるWeb開発をハンズオンで理解しよう|ハイクラス転職・求人情報サイト アンビ(AMBI)
    • 「Postgres で試した?」と聞き返せるようになるまでもしくはなぜ私は雰囲気で技術を語るのか? — Just use Postgres 読書感想文 - じゃあ、おうちで学べる

      はじめに 「Just use Postgres」という言葉を初めて聞いたのは、いつだったか覚えていません。Twitter か Hacker News か、あるいは社内の Slack か。どこで聞いたにせよ、私の反応は決まっていました。「また極端なことを言う人がいる」と。 「それ、〇〇でもできますよ」——この手のフレーズはもう100回は聞いてきました。そして大抵の場合、その〇〇は専用ツールに置き換えられていきます。技術が専門分化していくのは自然な流れです。 全文検索なら Elasticsearch。時系列データなら InfluxDB。メッセージキューなら RabbitMQ。それぞれの分野に専門家がいて、専用のソリューションがあって、ベストプラクティスがあります。「とりあえず Postgres で」なんて、それは思考停止ではないか、と。でも、心のどこかで気になっていたんです。 www.mann

        「Postgres で試した?」と聞き返せるようになるまでもしくはなぜ私は雰囲気で技術を語るのか? — Just use Postgres 読書感想文 - じゃあ、おうちで学べる
      • 【2020年】CTF Web問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい

        はじめに 対象イベント 読み方、使い方 Remote Code Execution(RCE) 親ディレクトリ指定によるopen_basedirのバイパス PHP-FPMのTCPソケット接続によるopen_basedirとdisable_functionsのバイパス JavaのRuntime.execでシェルを実行 Cross-Site Scripting(XSS) nginx環境でHTTPステータスコードが操作できる場合にCSPヘッダーを無効化 GoogleのClosureLibraryサニタイザーのXSS脆弱性 WebのProxy機能を介したService Workerの登録 括弧を使わないXSS /記号を使用せずに遷移先URLを指定 SOME(Same Origin Method Execution)を利用してdocument.writeを順次実行 SQL Injection MySQ

          【2020年】CTF Web問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい
        • SQLiteでベクトル検索ができる拡張sqlite-vssを試す|mah_lab / 西見 公宏

          SQLiteでベクトル検索を可能にするsqlite-vssそんなポータブルで便利なSQLiteですが、そのSQLiteでベクトル検索ができるとなるとより夢が広がります。 SQLite自体はファイルベースなので、あらかじめベクトルデータを設定したSQLiteデータベースファイルをアプリに組み込んで配布しても良いわけです。そうすればデータベースサーバを用意しなくて済む分コストも圧縮されますし、組み込みなのでアプリからは軽量に動作します。 ホスティングする場合でもFly.ioのようにボリュームイメージを利用できるPaaSを利用すれば、問題なく運用が可能です。 前置きが長くなりましたが、このような夢を叶えてくれる拡張がsqlite-vssです。ベクトル検索はFaissベースで実装されています。 とっても良さげではあるのですが、実際に組み込んでみた場合のコード例が見つからなかったので、手を動かして試

            SQLiteでベクトル検索ができる拡張sqlite-vssを試す|mah_lab / 西見 公宏
          • Build your own SQLite, Part 1: Listing tables

            As developers, we use databases all the time. But how do they work? In this series, we'll try to answer that question by building our own SQLite-compatible database from scratch. Source code examples will be provided in Rust, but you are encouraged to follow along using your language of choice, as we won't be relying on many language-specific features or libraries. As an introduction, we'll implem

              Build your own SQLite, Part 1: Listing tables
            • Joining CSV and JSON data with an in-memory SQLite database

              Sponsored by: Honeycomb — AI agents behave unpredictably. Get the context you need to debug what actually happened. Read the blog 19th June 2021 The new sqlite-utils memory command can import CSV and JSON data directly into an in-memory SQLite database, combine and query it using SQL and output the results as CSV, JSON or various other formats of plain text tables. sqlite-utils memory The new feat

                Joining CSV and JSON data with an in-memory SQLite database
              • Intro, Data Modeling, Databases | Prisma's Data Guide

                Learn how databases work, how to choose the right one, and how to use databases with your applications to their full potential. Introduction to databasesLearn the basics of what databases are, why they are so important for most software, and which types of databases are best for different use cases. Start from the fundamentals to give yourself a solid foundation. What are databases?Comparing datab

                  Intro, Data Modeling, Databases | Prisma's Data Guide
                • Welcome to Wildebeest: the Fediverse on Cloudflare

                  The Fediverse has been a hot topic of discussion lately, with thousands, if not millions, of new users creating accounts on platforms like Mastodon to either move entirely to "the other side" or experiment and learn about this new social network. Today we're introducing Wildebeest, an open-source, easy-to-deploy ActivityPub and Mastodon-compatible server built entirely on top of Cloudflare's Super

                    Welcome to Wildebeest: the Fediverse on Cloudflare
                  • Hono + htmx + Cloudflare is a new stack - Yusuke Wada

                    import Image from '../../components/R2Image.astro'; As a former backend engineer, I sometimes find React complex. Moreover, as a framework developer, creating a hydration mechanism can be troublesome. But we often end up using React. One of the main advantages of using React is JSX. At first, JSX seems strange - "Why are HTML tags in JavaScript!!!" However, once I get used to it, I find that JSX i

                      Hono + htmx + Cloudflare is a new stack - Yusuke Wada
                    • Parsing SQL - Strumenta

                      The code for this tutorial is on GitHub: parsing-sql SQL is a language to handle data in a relational database. If you worked with data you have probably worked with SQL. In this article we will talk about parsing SQL. It is in the same league of HTML: maybe you never learned it formally but you kind of know how to use it. That is great because if you know SQL, you know how to handle data. However

                        Parsing SQL - Strumenta
                      • A can of shardines: SQLite multitenancy with Rails

                        There is a pattern I am very fond of - “one database per tenant” in web applications with multiple, isolated users. Recently, I needed to fix an application I had for a long time where this database-per-tenant multitenancy utterly broke down, because I was doing connection management wrong. Which begat the question: how do you even approach doing it right? And it turns out I was not alone in this.

                        • Emacs 29 is nigh! What can we expect?

                          Some random rambling by a linguistics nerd about Emacs, Linux, and conlanging It was announced a couple of hours ago, Emacs 29’s branch is now cut from the master branch! This means the emacs-29 branch will from now no longer receive any new feature, but only bug fixes. So, what’s new with this new major release? I skimmed over the NEWS file, and here are the changes which I find interesting and e

                          • Deprecating and removing Web SQL  |  Blog  |  Chrome for Developers

                            The Web SQL Database API, which allows you to store data in a structured manner on the user's computer (internally based on the SQLite database engine), was introduced in April 2009 and abandoned in November 2010. While it was implemented in WebKit (which powers Safari) and remained active in the Blink engine (which powers Chrome), Gecko (which powers Firefox) never implemented this feature and We

                            • Building D1: a Global Database

                              Developers who build Worker applications focus on what they're creating, not the infrastructure required, and benefit from the global reach of Cloudflare's network. Many applications require persistent data, from personal projects to business-critical workloads. Workers offer various database and storage options tailored to developer needs, such as key-value and object storage. Relational database

                                Building D1: a Global Database
                              • Cloudflare WorkersでサーバーレスPythonアプリを構築してみよう | gihyo.jp

                                筒井(@ryu22e)です。2024年7月の「Python Monthly Topics」は、Cloudflare WorkersのPythonサポートについて解説します。 前半ではCloudflare WorkersでPythonを使う方法について、後半ではCloudflare WorkersでPythonを動かす仕組みと技術的制限について解説します。 なお、Cloudflare WorkersのPythonサポートは本記事執筆時点(2024年7月24日)でオープンベータ版です。正式リリース時には仕様が変更される可能性があります。また、一部機能はローカル環境でしか利用できません。 Cloudflare Workersとは Cloudflare Workersは、Cloudflareが提供するサーバーレスアプリケーションを構築・デプロイするためのプラットフォームです。主に以下のような特徴が

                                  Cloudflare WorkersでサーバーレスPythonアプリを構築してみよう | gihyo.jp
                                • Claude Code SDK ではじめる 定額 AI Agent 開発入門 - LayerX エンジニアブログ

                                  こちらは LayerX AI Agentブログリレー 7日目の記事です。 こんにちは。バクラク勤怠のソフトウェアエンジニアの @upamune です。 最近は社内のいろんなリソースをMarkdownに変換する怪物になっています。 1. はじめに:定額で始めるAI Agent開発 皆さんAI Agent開発していますか?AI Agentを開発する時の障壁の一つとして、LLMを呼び出す際のAPIコールが従量課金のため、なかなか個人で気軽に試せないというのがあると思います。 そこで、今回はClaude Code SDKを利用してAI Agentを作成することで、Pro/Maxプランに加入することで定額でAI Agentを開発できる選択肢があることを紹介します。 2. なぜClaude Code SDKなのか Claude Codeを利用している方は多いと思いますが、Claude Code SDK

                                    Claude Code SDK ではじめる 定額 AI Agent 開発入門 - LayerX エンジニアブログ
                                  • 100000 TPS over a billion rows: the unreasonable effectiveness of SQLite

                                    100000 TPS over a billion rows: the unreasonable effectiveness of SQLite 02 Dec 2025 SQLite doesn't have MVCC! It only has a single writer! SQLite is for phones and mobile apps (and the occasional airliner)! For web servers use a proper database like Postgres! In this article I'll go over why being embedded and a single writer are not deficiencies but actually allow SQLite to scale so unreasonably

                                    • SQLite FTS : trigram tokenizerでunigram&bigram検索までサポート-日本語全文検索

                                      SQLite FTS : trigram tokenizerでunigram&bigram検索までサポート-日本語全文検索 2023.06.20 ### 前段 2023年現在、全文検索システムをセルフホストしようとした場合に、 Elasticsearch、OpenSearch、Meilisearch(最近勢いありますね) がまずメジャーどころで候補にあがるとおもいますが、これ以外にSQliteという選択肢もあります。 SQLiteには、デフォルトで有効の拡張機能として全文検索 FTS(Full-Text-Search)があります。 SQLite FTSはSQLite自体の特徴である優秀なポータビリティ、SQLで扱える習得運用コストの低さ、何より必要十分過ぎる検索速度があります。 ローカル/エッジといった環境向けなら個人的にはかなりオススメと感じています。 今回は SQLite FTS での

                                        SQLite FTS : trigram tokenizerでunigram&bigram検索までサポート-日本語全文検索
                                      • A future for SQL on the web

                                        I discovered something absurd recently and I’m very excited to tell you about it. The end result is absurd-sql, and it’s a persistent backend for SQLite on the web. That means it doesn’t have to load the whole db into memory, and writes persist. In this post I will explain the absurdities of the web’s storage APIs (mainly IndexedDB), show how SQLite provides a 10x perf improvement, explain all the

                                        • SQLite Wasm in the browser backed by the Origin Private File System  |  Blog  |  Chrome for Developers

                                          SQLite is a popular, open-source, lightweight, embedded relational database management system. Many developers use it to store data in a structured, easy-to-use manner. Because of its small size and low memory requirements, SQLite is often leveraged as a database engine in mobile devices, desktop applications, and web browsers. One of the key features of SQLite is that it is a serverless database,

                                          • Against SQL

                                            TLDR The relational model is great: A shared universal data model allows cooperation between programs written in many different languages, running on different machines and with different lifespans. Normalization allows updating data without worrying about forgetting to update derived data. Physical data independence allows changing data-structures and query plans without having to change all of y

                                            • PostgreSQL 15にMERGE文UPSERTがやってくる | DevelopersIO

                                              UPSERT とは データベースにレコードを反映する際、100%新規データを扱うのであれば、テーブルにINSERTするだけですみます。 更新データも存在する場合、新規の場合は INSERT 、更新の場合は UPDATE というように処理を振り分ける必要があります。 このように、データの状態によって UPDATE と INSERT を使い分けることを、UPDATE と INSERT をくっつけて UPSERT と呼びます。 PostgreSQL は9.5で INSERT を試し、制約違反が発生すれば UPDATE する INSERT ... ON CONFLICT 構文の UPSERT に対応しました。 PostgreSQL 以外にも、MySQLやSQLiteがこの方式のUPSERTに対応しています。 INSERT INTO target(tid, val) VALUES(123, 10)

                                                PostgreSQL 15にMERGE文UPSERTがやってくる | DevelopersIO
                                              • DuckDB in Actionの読書メモ

                                                1章 イントロダクション DuckDBとは シングルノードでinmemoryな組み込みデータベース 処理中のデータが永続化されない 個人情報、機密データの扱いに困らない データパイプライン (ETL) ギガバイトなデータを効果的に扱える 数秒でハンドリング可能な処理機構 でもテラバイト級だとさすがに無理 MITライセンス 入出力として扱えるデータソース csv Json Parquet Arrow MySQL SQLite PostgreSQL Jupyterを経由して、PandasやPolarsから問い合わせできる 並列化されたクエリエンジン 費用面で高コストなAWS Athena SQLを使わずともすむ DuckDBのSQL 標準ANSI SQL Window関数, CTEも扱える 分析関数 count, min, max 独自拡張されたSQL構文 select exclude() /

                                                  DuckDB in Actionの読書メモ
                                                • In search of a faster SQLite - blag

                                                  Disclosure: I work with one of the paper’s authors at Turso SQLite is already fast. But can we make it even faster? Researchers at the University of Helsinki and Cambridge began with this question and published a paper, “Serverless Runtime / Database Co-Design With Asynchronous I/O”. They demonstrate up to a 100x reduction in tail latency. These are my notes on the paper. This is the foundational

                                                  • 【Python】SQLite で日本語を全文検索するコード例【N-Gram, FTS4/FTS5】

                                                    日本語の全文検索ぜんぶんけんさく (full-text search, FTS) を、高速に実行する Python コード例です。 Python の標準モジュール sqlite3 を使用しました。 sqlite3 から、SQLiteエスキューライト の全文検索 (FTSエフティーエス) を使ってみました。 試したのは、FTS4エフティーエスフォー と FTS5エフティーエスファイブ の2種類です。 ところで、SQLite の読み方は色々ありました。YouTube では、エスキューライト、エスキューエライト、スィクライト、スィクエライト、などの発音を聞きました。 全文検索の使い方(FTS の使い方)ですが、テキストを N-Gram にして、FTS4 か FTS5 の仮想テーブルに INSERT するだけでした。 (2022年2月5日 追記)MeCab の使い方も書きました。 MeCab で

                                                      【Python】SQLite で日本語を全文検索するコード例【N-Gram, FTS4/FTS5】
                                                    • GitHub - phiresky/sqlite-zstd: Transparent dictionary-based row-level compression for SQLite

                                                      The data will be moved to _table_name_zstd, while table_name will be a view that can be queried as normally, including SELECT, INSERT, UPDATE, and DELETE queries. This function will not compress any data by itself, you need to call zstd_incremental_maintenance afterwards. config is a json object describing the configuration. See TransparentCompressConfig for detail. The following differences apply

                                                        GitHub - phiresky/sqlite-zstd: Transparent dictionary-based row-level compression for SQLite
                                                      • Origin Private File System を基盤とするブラウザ内の SQLite Wasm  |  Blog  |  Chrome for Developers

                                                        SQLite は、よく利用されているオープンソースの軽量な組み込みリレーショナル データベース管理システムです。多くのデベロッパーが、構造化された使いやすい方法でデータを保存するために使用しています。SQLite はサイズが小さく、メモリ要件が低いため、モバイル デバイス、デスクトップ アプリケーション、ウェブブラウザのデータベース エンジンとしてよく利用されます。 SQLite の主な特長の 1 つは、サーバーレス データベースであることです。つまり、動作に個別のサーバー プロセスを必要としません。代わりに、データベースはユーザーのデバイス上の単一のファイルに保存されるため、アプリケーションに簡単に統合できます。 Web アセンブリに基づく SQLite Web Assembly(Wasm)に基づく非公式の SQLite バージョンが多数存在し、ウェブブラウザで使用できます(例: sql

                                                        • Yes, I can connect to a DB in CSS

                                                          As they’re wont to do, a certain tweet was floating around the interwebs for a while the other week. Recruiters be like: We’re looking for someone who can connect to the database using CSS. It’s been a hell of a long time since I last embarked on a quality shitpost project1, in fact it’s been so long that back then I probably didn’t even have the word shitpost in my vocabulary. To that end, I was

                                                          • Introducing Bunny Database: The SQLite-Compatible Edge DB

                                                            Don’t want to babysit your app database on a VM but not willing to pay the DBaaS tax either? We're building a third way. Today, we’re launching Bunny Database as a public preview: a SQLite-compatible managed service that spins down when idle, keeps latency low wherever your users are, and doesn’t cost a fortune. So what’s the deal with database services in 2026?It’s become clear by now that the DB

                                                              Introducing Bunny Database: The SQLite-Compatible Edge DB
                                                            • I Migrated from a Postgres Cluster to Distributed SQLite with LiteFS

                                                              I Migrated from a Postgres Cluster to Distributed SQLite with LiteFSNovember 21st, 2022 — 22 min read Over the last few months, I've been heads-down on building the content for EpicWeb.dev. And I've been building it all in the open on my YouTube channel. If you've been watching my EpicWeb.dev live streams, you'll know that I've been building the app we'll use to learn web dev: Rocket Rental 🚀. Wi

                                                                I Migrated from a Postgres Cluster to Distributed SQLite with LiteFS
                                                              • SQLite Features You Didn’t Know It Had: JSON, text search, CTE, STRICT, generated columns, WAL

                                                                Working with JSON data SQLite ships with a JSON extension that lets you store and query JSON documents directly in tables. You can keep your schema flexible while still using SQL to slice and dice structured data. Example: extracting fields from a JSON column: CREATE TABLE events ( id INTEGER PRIMARY KEY, payload TEXT NOT NULL -- JSON ); SELECT json_extract(payload, '$.user.id') AS user_id, json_e

                                                                  SQLite Features You Didn’t Know It Had: JSON, text search, CTE, STRICT, generated columns, WAL
                                                                • Node.js(Express.js)環境でPrisma ORMを使いこなすための基礎 | アールエフェクト

                                                                  アプリケーションを構築する場合にはデータを保存するため必ずデータベースが必要となります。データベースを効率的に管理し、簡単に操作を行うためのツールがPrismaです。本文書はこれまでPrismaを利用したことがない人を対象にPrismaを利用する上での基本的な操作と設定方法について説明を行なっています。 Prismaはサーバからデータベースを操作する際にサーバとデータベースの間を仲介する役目を持っておりデータベースを操作する際はどのデータベースを利用しているか意識することなく共通のオブジェクトメソッドを利用することができます。本文書ではサーバにExpress.jsを利用して最初はデータベースのSQLiteを利用します。SQLiteで一通り動作を確認した後にクラウドサービスのSupabase(PostgreSQL)に変更します。データベースの変更を行なってもSQLiteで行なった処理と同じ操

                                                                    Node.js(Express.js)環境でPrisma ORMを使いこなすための基礎 | アールエフェクト
                                                                  • How we built an open-source SEO tool using Workers, D1, and Queues

                                                                    How we built an open-source SEO tool using Workers, D1, and Queues2023-03-02 Building applications on Cloudflare Workers has always been fun. Workers applications have low latency response times by default, and easy developer ergonomics thanks to Wrangler. It's no surprise that for years now, developers have been going from idea to production with Workers in just a few minutes. Internally, we're n

                                                                      How we built an open-source SEO tool using Workers, D1, and Queues
                                                                    • Supercharge SQLite with Ruby functions

                                                                      An interesting twist in my recent usage of SQLite was the fact that I noticed my research scripts and the database intertwine more. SQLite is unique in that it really lives in-process, unlike standalone database servers. There is a feature to that which does not get used very frequently, but can be indispensable in some situations. By the way, the talk about the system that made me me to explore S

                                                                      • Making static sites dynamic with Cloudflare D1

                                                                        There are many ways to store data in your applications. For example, in Cloudflare Workers applications, we have Workers KV for key-value storage and Durable Objects for real-time, coordinated storage without compromising on consistency. Outside the Cloudflare ecosystem, you can also plug in other tools like NoSQL and graph databases. But sometimes, you want SQL. Indexes allow us to retrieve data

                                                                          Making static sites dynamic with Cloudflare D1
                                                                        • Logging C Function Calls

                                                                          May 19th, 2022 @ justine's web page Logging C Functions One of my favorite features of the Cosmopolitan Libc runtime is its --ftrace flag that logs C function calls. It's the simplest system for debugging programs I've ever used and it surprises me that I found no evidence of someone having invented it before. Here's one of its most important use cases. Have you ever had you debugger stupified by

                                                                          • Introducing TanStack Start Middleware – Frontend Masters Blog

                                                                            TanStack Start is one of the most exciting full-stack web development frameworks I’ve seen. I’ve written about it before. In essence, TanStack Start takes TanStack Router, a superb, strongly-typed client-side JavaScript framework, and adds server-side support. This serves two purposes: it gives you a place to execute server-side code, like database access; and it enables server-side rendering, or

                                                                              Introducing TanStack Start Middleware – Frontend Masters Blog
                                                                            • SQLite Index Visualization: Structure

                                                                              After learning about indexes, I understood their basic structure, but I wanted to dig deeper — to explore the data structure, understand the algorithm, and learn how the index data is stored on disk. The theory and actual implementation can differ, so I decided to explore this topic further. I wanted to see how a database management system (DBMS) stores an index in both disk and memory, and how it

                                                                              • sqlite3 1万件を超えるならUPDATE/DELETEは使っちゃダメ

                                                                                PHP+PDOでsqlite3のデータベースを使うことがありました。 データ件数は、1日1000件ぐらい増える感じで、1万件、5万件、10万件と増えていきます。 当然追加(INSERT)する際は、PK(実際はインデックスなし)の存在を確認してInsert Or Updateな処理が必要になります。 件数が多くなるとトランザクションは必須です。 テストデータは、5万件超えのもので確認しています。 何も考えずに、select pk from tbl where pk=?的なSQLで検索して、存在しなければInsert、存在すればUpdateという処理にすると (以下、msec=ミリ秒です。) select発行コストは、1件あたり0.001sec(1msec)とごくわずかな時間でした。が、 UPDATE発行コストは、1件あたり0.06sec(60msec)もかかります。 10件で、600msec

                                                                                  sqlite3 1万件を超えるならUPDATE/DELETEは使っちゃダメ
                                                                                • Bashing JSON into Shape with SQLite

                                                                                  Published on 2022-01-04, 1640 words, 6 minutes to read It is clear that most of the world has decided that they want to use JSON for their public-facing API endpoints. However, most of the time you will need to deal with storage engines that don't deal with JSON very well. This can be confusing to deal with because you need to fit a square peg into a round hole. However, SQLite added JSON function