রুম
সর্বশেষ আপডেট | স্থিতিশীল রিলিজ | প্রার্থী মুক্তি | বিটা রিলিজ | আলফা রিলিজ |
---|---|---|---|---|
8 অক্টোবর, 2025 | 2.8.2 | - | - | - |
নির্ভরতা ঘোষণা করা
রুমের উপর নির্ভরতা যোগ করতে, আপনাকে অবশ্যই আপনার প্রকল্পে Google Maven সংগ্রহস্থল যোগ করতে হবে। আরও তথ্যের জন্য Google এর Maven সংগ্রহস্থল পড়ুন।
রুমের নির্ভরতাগুলির মধ্যে রয়েছে টেস্টিং রুম মাইগ্রেশন এবং রুম RxJava
আপনার অ্যাপ বা মডিউলের জন্য build.gradle
ফাইলে আপনার প্রয়োজনীয় আর্টিফ্যাক্টগুলির জন্য নির্ভরতা যোগ করুন:
কোটলিন
dependencies { val room_version = "2.8.2" implementation("androidx.room:room-runtime:$room_version") // If this project uses any Kotlin source, use Kotlin Symbol Processing (KSP) // See Add the KSP plugin to your project ksp("androidx.room:room-compiler:$room_version") // If this project only uses Java source, use the Java annotationProcessor // No additional plugins are necessary annotationProcessor("androidx.room:room-compiler:$room_version") // optional - Kotlin Extensions and Coroutines support for Room implementation("androidx.room:room-ktx:$room_version") // optional - RxJava2 support for Room implementation("androidx.room:room-rxjava2:$room_version") // optional - RxJava3 support for Room implementation("androidx.room:room-rxjava3:$room_version") // optional - Guava support for Room, including Optional and ListenableFuture implementation("androidx.room:room-guava:$room_version") // optional - Test helpers testImplementation("androidx.room:room-testing:$room_version") // optional - Paging 3 Integration implementation("androidx.room:room-paging:$room_version") }
গ্রোভি
dependencies { def room_version = "2.8.2" implementation "androidx.room:room-runtime:$room_version" // If this project uses any Kotlin source, use Kotlin Symbol Processing (KSP) // See KSP Quickstart to add KSP to your build ksp "androidx.room:room-compiler:$room_version" // If this project only uses Java source, use the Java annotationProcessor // No additional plugins are necessary annotationProcessor "androidx.room:room-compiler:$room_version" // optional - RxJava2 support for Room implementation "androidx.room:room-rxjava2:$room_version" // optional - RxJava3 support for Room implementation "androidx.room:room-rxjava3:$room_version" // optional - Guava support for Room, including Optional and ListenableFuture implementation "androidx.room:room-guava:$room_version" // optional - Test helpers testImplementation "androidx.room:room-testing:$room_version" // optional - Paging 3 Integration implementation "androidx.room:room-paging:$room_version" }
KAPT প্লাগইন ব্যবহার করার তথ্যের জন্য, KAPT ডকুমেন্টেশন দেখুন।
KSP প্লাগইন ব্যবহারের তথ্যের জন্য, KSP কুইক-স্টার্ট ডকুমেন্টেশন দেখুন।
Kotlin এক্সটেনশন ব্যবহার করার তথ্যের জন্য, ktx ডকুমেন্টেশন দেখুন।
নির্ভরতা সম্পর্কে আরও তথ্যের জন্য, বিল্ড নির্ভরতা যুক্ত করুন দেখুন।
ঐচ্ছিকভাবে, নন-অ্যান্ড্রয়েড লাইব্রেরির জন্য (যেমন জাভা বা কোটলিন শুধুমাত্র গ্রেডল মডিউল) আপনি রুম টীকা ব্যবহার করতে androidx.room:room-common
এর উপর নির্ভর করতে পারেন।
কম্পাইলার বিকল্পগুলি কনফিগার করা হচ্ছে
রুম নিম্নলিখিত টীকা প্রসেসর বিকল্প আছে.
room.schemaLocation | directory প্রদত্ত ডিরেক্টরিতে JSON ফাইলগুলিতে ডাটাবেস স্কিমা রপ্তানি সক্ষম করে৷ আরও তথ্যের জন্য রুম মাইগ্রেশন দেখুন। |
room.incremental | boolean Gradle ইনক্রিমেন্টাল টীকা প্রসেসর সক্ষম করে। ডিফল্ট মান true । |
room.generateKotlin | boolean জাভার পরিবর্তে কোটলিন সোর্স ফাইল তৈরি করুন। KSP প্রয়োজন। ডিফল্ট মান সংস্করণ 2.7.0 হিসাবে true । আরও বিস্তারিত জানার জন্য সংস্করণ 2.6.0 নোটগুলি দেখুন, যখন এটি চালু করা হয়েছিল। |
রুম গ্রেডল প্লাগইন ব্যবহার করুন
রুম সংস্করণ 2.6.0 এবং উচ্চতর, আপনি রুম কম্পাইলারের বিকল্পগুলি কনফিগার করতে রুম গ্রেডল প্লাগইন ব্যবহার করতে পারেন। প্লাগইনটি প্রজেক্টটিকে এমনভাবে কনফিগার করে যাতে জেনারেট করা স্কিমাগুলি (যা কম্পাইল টাস্কগুলির একটি আউটপুট এবং স্বয়ংক্রিয়-মাইগ্রেশনের জন্য ব্যবহৃত হয়) সঠিকভাবে পুনরুত্পাদনযোগ্য এবং ক্যাশেযোগ্য বিল্ডের জন্য কনফিগার করা হয়।
প্লাগইন যোগ করতে, আপনার শীর্ষ-স্তরের গ্রেডল বিল্ড ফাইলে, প্লাগইন এবং এর সংস্করণটি সংজ্ঞায়িত করুন।
গ্রোভি
plugins { id 'androidx.room' version "$room_version" apply false }
কোটলিন
plugins { id("androidx.room") version "$room_version" apply false }
মডিউল-স্তরের গ্রেডল বিল্ড ফাইলে, প্লাগইনটি প্রয়োগ করুন এবং room
এক্সটেনশন ব্যবহার করুন।
গ্রোভি
plugins { id 'androidx.room' } android { ... room { schemaDirectory "$projectDir/schemas" } }
কোটলিন
plugins { id("androidx.room") } android { ... room { schemaDirectory("$projectDir/schemas") } }
রুম গ্রেডল প্লাগইন ব্যবহার করার সময় একটি schemaDirectory
সেট করা প্রয়োজন। এটি রুম কম্পাইলার এবং বিভিন্ন কম্পাইল কাজ এবং এর ব্যাকএন্ড (javac, KAPT, KSP) কনফিগার করবে স্কিমা ফাইলগুলিকে স্বাদযুক্ত ফোল্ডারে আউটপুট করতে, উদাহরণস্বরূপ schemas/flavorOneDebug/com.package.MyDatabase/1.json
। এই ফাইলগুলিকে যাচাইকরণ এবং স্বয়ংক্রিয় স্থানান্তরের জন্য ব্যবহার করার জন্য সংগ্রহস্থলে চেক করা উচিত।
কিছু বিকল্প রুম গ্রেডল প্লাগইনের সমস্ত সংস্করণে কনফিগার করা যায় না, যদিও সেগুলি রুম কম্পাইলার দ্বারা সমর্থিত। নীচের সারণী প্রতিটি বিকল্পের তালিকা করে এবং রুম গ্রেডল প্লাগইনের সংস্করণ দেখায় যা room
এক্সটেনশন ব্যবহার করে সেই বিকল্পটি কনফিগার করার জন্য সমর্থন যোগ করে। যদি আপনার সংস্করণ কম হয়, বা বিকল্পটি এখনও সমর্থিত না হয়, আপনি পরিবর্তে টীকা প্রসেসর বিকল্পগুলি ব্যবহার করতে পারেন।
অপশন | সংস্করণ থেকে |
---|---|
room.schemaLocation (প্রয়োজনীয়) | 2.6.0 |
room.incremental | - |
room.generateKotlin | - |
টীকা প্রসেসর বিকল্প ব্যবহার করুন
আপনি যদি রুম গ্রেডল প্লাগইন ব্যবহার না করে থাকেন, অথবা আপনি যে বিকল্পটি চান সেটি প্লাগইনের আপনার সংস্করণ দ্বারা সমর্থিত না হলে, আপনি টীকা প্রসেসর বিকল্পগুলি ব্যবহার করে রুম কনফিগার করতে পারেন, যেমন বিল্ড বিল্ড নির্ভরতা যোগ করুন এ বর্ণিত। আপনি কীভাবে টীকা বিকল্পগুলি নির্দিষ্ট করবেন তা নির্ভর করে আপনি রুমের জন্য KSP বা KAPT ব্যবহার করেন কিনা।
গ্রোভি
// For KSP ksp { arg("option_name", "option_value") // other otions... } // For javac and KAPT android { ... defaultConfig { ... javaCompileOptions { annotationProcessorOptions { arguments += [ "option_name":"option_value", // other options... ] } } } }
কোটলিন
// For KSP ksp { arg("option_name", "option_value") // other options... } // For javac and KAPT android { ... defaultConfig { ... javaCompileOptions { annotationProcessorOptions { arguments += mapOf( "option_name" to "option_value", // other options... ) } } } }
যেহেতু room.schemaLocation
একটি ডিরেক্টরি এবং একটি আদিম প্রকার নয়, এই বিকল্পটি যোগ করার সময় একটি CommandLineArgumentsProvider
ব্যবহার করা প্রয়োজন যাতে গ্রেডল আপ-টু-ডেট চেক পরিচালনা করার সময় এই ডিরেক্টরি সম্পর্কে জানতে পারে। আপনার রুম ডাটাবেস মাইগ্রেট করুন CommandLineArgumentsProvider
এর সম্পূর্ণ বাস্তবায়ন দেখায় যা স্কিমা অবস্থান প্রদান করে।
প্রতিক্রিয়া
আপনার প্রতিক্রিয়া জেটপ্যাককে আরও ভাল করতে সাহায্য করে। আপনি যদি নতুন সমস্যা আবিষ্কার করেন বা এই লাইব্রেরির উন্নতির জন্য ধারনা পান তাহলে আমাদের জানান। আপনি একটি নতুন তৈরি করার আগে অনুগ্রহ করে এই লাইব্রেরিতে বিদ্যমান সমস্যাগুলি দেখুন৷ আপনি তারকা বোতামে ক্লিক করে একটি বিদ্যমান সমস্যায় আপনার ভোট যোগ করতে পারেন।
আরও তথ্যের জন্য ইস্যু ট্র্যাকার ডকুমেন্টেশন দেখুন।
সংস্করণ 2.8
সংস্করণ 2.8.2
অক্টোবর 08, 2025
androidx.room:room-*:2.8.2
প্রকাশিত হয়েছে। সংস্করণ 2.8.2-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- একটি ফ্লো নির্গমন ( b/446643789 ) থেকে একটি স্বয়ংক্রিয়-বন্ধ ডাটাবেস পুনরায় খোলার সময় ঘটতে পারে এমন একটি অচলাবস্থার সমাধান করুন।
সংস্করণ 2.8.1
সেপ্টেম্বর 24, 2025
androidx.room:room-*:2.8.1
প্রকাশিত হয়েছে। সংস্করণ 2.8.1-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- একটি সাসপেন্ড ল্যাম্বডা দিয়ে একটি DAO ফাংশন প্রক্রিয়া করার সময় ঘটতে পারে এমন একটি প্রসেসর ক্র্যাশ ঠিক করুন। ( b/442220723 )।
- একটি রেসের অবস্থা ঠিক করুন যা ফ্লোকে সর্বশেষ আপডেট হওয়া থেকে আটকাতে পারে।
সংস্করণ 2.8.0
10 সেপ্টেম্বর, 2025
androidx.room:room-*:2.8.0
প্রকাশিত হয়েছে। সংস্করণ 2.8.0-এ এই কমিট রয়েছে।
2.7.0 থেকে গুরুত্বপূর্ণ পরিবর্তন:
- একটি নতুন আর্টিফ্যাক্ট যোগ করা হয়েছে
androidx.room:room-sqlite-wrapper
যাতে একটি কনফিগার করাSQLiteDriver
সহ একটিRoomDatabase
থেকে একটিSupportSQLiteDatabase
র্যাপার পেতে API গুলি রয়েছে৷ র্যাপার পেতে নতুন এক্সটেনশন ফাংশন ব্যবহার করুনRoomDatabase.getSupportWrapper()
।SupportSQLiteDatabase
এর ব্যবহার বজায় রাখার জন্য এটি একটি সামঞ্জস্যপূর্ণ আর্টিফ্যাক্ট, সাধারণতroomDatabase.openHelper.writableDatabase
থেকে প্রাপ্ত হয়, এমনকি যদি রুম ডেটাবেসSQLiteDriver
সাথে কনফিগার করা থাকে। এই মোড়কটি কোডবেসগুলির ক্রমবর্ধমান স্থানান্তরের জন্য উপযোগী যারা SQLiteDriver API গ্রহণ করতে চান কিন্তু SupportSQLite API-এর ব্যাপক ব্যবহার রয়েছে তবুও তারাBundledSQLiteDriver
এর সুবিধা নিতে চান। আরও তথ্যের জন্য মাইগ্রেশন গাইড দেখুন। - KMP লক্ষ্য ওয়াচ ওএস এবং টিভি ওএসের জন্য সমর্থন যোগ করা হয়েছে।
- লাইব্রেরির Android minSDK API 21 থেকে API 23-এ আপডেট করা হয়েছে
সংস্করণ 2.8.0-rc02
আগস্ট 27, 2025
androidx.room:room-*:2.8.0-rc02
প্রকাশিত হয়েছে। সংস্করণ 2.8.0-rc02-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- API 21 থেকে API 23 এ minSDK আপডেট করুন ( Ibdfca , b/380448311 , b/435705964 , b/435705223 )
- 8.1 থেকে 8.4 পর্যন্ত Room Gradle Plugin-এর সাথে সামঞ্জস্যপূর্ণ ন্যূনতম Android Gradle Plugin (AGP) সংস্করণ আপডেট করুন৷ ( Ia0d28 )
বাগ ফিক্স
- প্রাক-প্যাকেজড ডাটাবেসের জন্য মাইগ্রেশন পাথ উপলব্ধ থাকলেও একটি ধ্বংসাত্মক মাইগ্রেশন সঞ্চালিত হচ্ছে এমন একটি সমস্যা সমাধান করুন ( b/432634197 )।
সংস্করণ 2.8.0-rc01
13 আগস্ট, 2025
androidx.room:room-*:2.8.0-rc01
প্রকাশিত হয়েছে। সংস্করণ 2.8.0-rc01-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
বাগ ফিক্স
- একটি রেস কন্ডিশন ঠিক করুন যেখানে রুম ফ্লোস একটি অ্যাসিঙ্ক্রোনাস মাল্টি-কোয়েরি/রাইট পরিস্থিতিতে সর্বশেষ ক্যোয়ারী ফলাফল নির্গত করবে না। ( Ic9a3c )
সংস্করণ 2.8.0-beta01
আগস্ট 1, 2025
androidx.room:room-*:2.8.0-beta01
প্রকাশিত হয়েছে। সংস্করণ 2.8.0-beta01-এ এই কমিট রয়েছে।
বাগ ফিক্স
- ধ্বংসাত্মক মাইগ্রেশনের সময় টেবিল এবং ভিউ নামগুলি এখন সঠিকভাবে এড়িয়ে গেছে। ( 9e55f8 , b/427095319 )
সংস্করণ 2.8.0-alpha01
জুলাই 16, 2025
androidx.room:room-*:2.8.0-alpha01
প্রকাশিত হয়েছে। সংস্করণ 2.8.0-alpha01-এ এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
- একটি কনফিগার করা
SQLiteDriver
সাথেRoomDatabase
এর একটিSupportSQLiteDatabase
র্যাপার পেতে APIs ধারণ করে একটি নতুন আর্টিফ্যাক্টandroidx.room:room-sqlite-wrapper
যোগ করা হয়েছে। র্যাপার পেতে নতুন এক্সটেনশন ফাংশন ব্যবহার করুনRoomDatabase.getSupportWrapper()
। এটিSupportSQLiteDatabase
এর ব্যবহার বজায় রাখার জন্য একটি সামঞ্জস্যপূর্ণ আর্টিফ্যাক্ট, সাধারণতRoomDatabase.openHelper.writableDatabase
থেকে প্রাপ্ত হয়, এমনকি যদি রুম ডেটাবেসSQLiteDriver
দিয়ে কনফিগার করা হয়। এই মোড়কটি কোডবেসগুলির ক্রমবর্ধমান স্থানান্তরের জন্য দরকারী যারাSQLiteDriver
গ্রহণ করতে চান কিন্তুSupportSQLite
API-এর ব্যাপক ব্যবহার রয়েছে তবুও তারাBundledSQLiteDriver
এর সুবিধা নিতে চান। ( ICf6ac ) - Watch OS এবং TV OS ( I228f6 , b/394238801 ) এর জন্য KMP লক্ষ্য যোগ করুন
বাগ ফিক্স
- স্থগিত লেনদেন এবং
AndroidSQLiteDriver
ব্যবহার করার সময় মাঝে মাঝে ঘটতে পারে এমন একটি অচলাবস্থার সমাধান করুন৷ ( b/415006268 )
সংস্করণ 2.7
সংস্করণ 2.7.2
18 জুন, 2025
androidx.room:room-*:2.7.2
প্রকাশিত হয়েছে। সংস্করণ 2.7.2-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- KSP এর সাথে নেটিভ সোর্স প্রসেস করার সময় যেখানে স্কিমা এক্সপোর্ট অনুপস্থিত থাকে সেখানে টীকা মান ভুলভাবে পড়া হবে এমন একটি সমস্যা সমাধান করুন। ( b/416549580 )
- একটি বাগ ফিক্স করুন যেখানে একটি SQL-এ অগ্রণী মন্তব্যের ফলে বিবৃতিগুলি এমনভাবে কার্যকর করা হবে যেন সেগুলি অ-পঠিত প্রশ্ন। ( b/413061402 )
- স্কিমা ডিরেক্টরি খালি থাকার কারণে রুমের গ্রেডল প্লাগইন কনফিগার করতে ব্যর্থ হওয়ার সাথে একটি সমস্যা সমাধান করুন। ( b/417823384 )
- একটি সংযোগ পেতে খুব বেশি সময় লাগলে আর
SQLiteException
নিক্ষেপ করবেন না, পরিবর্তে একটি লগ বার্তা পাঠাবে লাইব্রেরি দ্বারা। থ্রো করার পরিবর্তে লগিং আইওএস সাসপেন্ডিং লুপারের চারপাশে কাজ করে যার ফলে রুম ভুল ব্যাখ্যা করতে পারে যা সংযোগটি অর্জন করার সময় Kotlin Coroutine এ ঘটে এবং এইভাবে একটি iOS অ্যাপ ব্যাকগ্রাউন্ড করা হয় এবং পরে ডাটাবেস অপারেশনের মাঝখানে পুনরায় চালু করা হয় তখন ব্যতিক্রমটি নিক্ষেপ করা থেকে প্রতিরোধ করে। ( b/422448815 )
সংস্করণ 2.7.1
23 এপ্রিল, 2025
androidx.room:room-*:2.7.1
প্রকাশিত হয়েছে। সংস্করণ 2.7.1-এ এই কমিটগুলি রয়েছে।
বাগ ফিক্স
- প্রদত্ত টাইপ রূপান্তরকারী বৈধতার সময়
IndexOutOfBoundsException
বাগ ঠিক করুন। ( b/409804755 )। - যখন একটি
SQLiteDriver
রুমের সাথে কনফিগার করা হয় তখনRoomDatabase.runInTransaction()
সমর্থন করুন। ( b/408364828 )।
সংস্করণ 2.7.0
9 এপ্রিল, 2025
androidx.room:room-*:2.7.0
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-এ এই কমিটগুলি রয়েছে।
2.6.0 থেকে গুরুত্বপূর্ণ পরিবর্তন
- কোটলিন মাল্টিপ্ল্যাটফর্ম (কেএমপি) সমর্থন: এই রিলিজে, রুমটিকে কোটলিন মাল্টিপ্ল্যাটফর্ম (কেএমপি) লাইব্রেরিতে পরিণত করার জন্য রিফ্যাক্টর করা হয়েছে। বর্তমান সমর্থিত প্ল্যাটফর্মগুলি হল অ্যান্ড্রয়েড, আইওএস, জেভিএম (ডেস্কটপ), নেটিভ ম্যাক এবং নেটিভ লিনাক্স। কিভাবে রুম KMP ব্যবহার শুরু করবেন সে সম্পর্কে আরও তথ্যের জন্য, অনুগ্রহ করে অফিসিয়াল রুম KMP ডকুমেন্টেশন দেখুন। KMP সমর্থনের অংশ হিসাবে, রুমটি একটি
SQLiteDriver
সাথেও কনফিগার করা যেতে পারে, কীভাবে একটি বিদ্যমান অ্যাপকে ড্রাইভার API এবং রুম KMP-এ স্থানান্তর করতে হয় সে সম্পর্কে তথ্যের জন্য, মাইগ্রেশন ডকুমেন্টেশন দেখুন। - KSP-তে Kotlin কোড জেনারেশন ডিফল্টরূপে চালু করা হয়েছে যদি KSP-এর মাধ্যমে প্রক্রিয়াকরণ করা হয়। KAPT বা জাভা শুধুমাত্র প্রকল্পগুলির জন্য, রুম এখনও জাভা উত্স তৈরি করবে।
- Kotlin 2.0 এবং KSP2: রুম এখন কোটলিন ভাষা 2.0 কে লক্ষ্য করে এবং কোটলিন 2.0 এবং সমতুল্য বা উচ্চতর ভাষার সংস্করণের সাথেও কম্পাইল করার জন্য প্রকল্পের প্রয়োজন হবে। KSP2-এর জন্য সমর্থন যোগ করা হয়েছে এবং Kotlin 2.0 বা উচ্চতর রুম ব্যবহার করার সময় সুপারিশ করা হয়।
সংস্করণ 2.7.0-rc03
26 মার্চ, 2025
androidx.room:room-*:2.7.0-rc03
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-rc03-এ এই কমিট রয়েছে।
বাগ ফিক্স
- DAO ফাংশন ( b/400584611 ) ব্লক করা সহ রুম ব্লকিং API-এর সঞ্চালনের সময় একটি থ্রেড বাধাপ্রাপ্ত হলে
InterruptedException
আর নিক্ষেপ করবেন না। -
SQLException: Error code: 5, message: Timed out attempting to acquire a reader connection.
এবং অনুরূপ সমস্যা ( b/380088809 )।
সংস্করণ 2.7.0-rc02
12 মার্চ, 2025
androidx.room:room-*:2.7.0-rc02
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-rc02-এ এই কমিট রয়েছে।
বাগ ফিক্স
- একটি FTS টেবিলে একটি নতুন কলাম ভুলভাবে পরিচালনা করা অটো মাইগ্রেশন ঠিক করুন। ( b/348227770 , Ic53f3 )
- KSP এর মাধ্যমে নন-JVM উত্স প্রক্রিয়া করার সময় একটি
NullPointerException
এর কারণে একটি রুম-কম্পাইলার ক্র্যাশ ঠিক করুন। ( b/396607230 , I693c9 ) - একটি সমস্যা সমাধান করুন যেখানে রুম লেখক সংযোগ ব্যবহার করার শেষে টেবিলগুলিকে বাতিল করবে না। ( b/340606803 , I73ef6 )
সংস্করণ 2.7.0-rc01
ফেব্রুয়ারী 26, 2025
androidx.room:room-*:2.7.0-rc01
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-rc01-এ এই কমিট রয়েছে।
বাগ ফিক্স
- একটি সমস্যা সমাধান করুন যেখানে রুম প্রাথমিক ডাটাবেস সংযোগে
busy_timeout
সেট করবে না যাSQLException: Error code: 5, message: database is locked
সমস্যা ( I93208 , b/380088809 )। - Kotlin 2.1.x এবং KSP1 ( I883b8 , b/396607230 ) এ নেটিভ সোর্স সেটগুলি (যেমন iOS) প্রসেস করার সময় রুমের কম্পাইলারে একটি সমস্যা সমাধান করুন যার ফলে KSP প্রসেসর ক্র্যাশ হয়ে যাবে।
সংস্করণ 2.7.0-beta01
12 ফেব্রুয়ারি, 2025
androidx.room:room-*:2.7.0-beta01
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-beta01-এ এই কমিট রয়েছে।
বাগ ফিক্স
-
RoomDatabase.inTransaction()
একটি বন্ধ ডাটাবেস খোলার সাথে একটি সমস্যা সমাধান করুন যখন এটি উচিত নয় এবং ডাটাবেস বন্ধ থাকলে দ্রুত মিথ্যা ফেরত দেওয়া উচিত ( b/325432967 )। - Kotlin ইনলাইন / ভ্যালু ক্লাস ( b/388299754 ) এর সাথে DAO ফাংশন প্রক্রিয়া করার সময় রুমের কম্পাইলারে একটি ক্র্যাশ (
IllegalArgumentException: not a valid name
) ঠিক করুন। -
room-runtime
JVM আর্টিফ্যাক্টে প্রোগার্ড নিয়মগুলি অন্তর্ভুক্ত করুন যাতে জেনারেট করা ডাটাবেস বাস্তবায়নের ডিফল্ট কনস্ট্রাক্টরটি সরানো না হয় কারণ এটি রুমের ডিফল্ট ইনিশিয়ালাইজেশন দ্বারা ব্যবহৃত হয় যা প্রতিফলন ( b/392657750 ) ব্যবহার করে।
সংস্করণ 2.7.0-alpha13
জানুয়ারী 29, 2025
androidx.room:room-*:2.7.0-alpha13
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha13-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- রুম এখন কোটলিন ভাষা 2.0 কে লক্ষ্য করে এবং কোটলিন 2.0 এবং সমতুল্য বা উচ্চ ভাষার সংস্করণের সাথে কম্পাইল করার জন্য প্রকল্পগুলির প্রয়োজন হবে। ( I8efb0 , b/315461431 , b/384600605 )
বাগ ফিক্স
- রুম কেএমপি ডাটাবেস বিল্ডারে একটি সমস্যা সমাধান করুন যখন অ্যান্ড্রয়েডে একটি পাথের পরিবর্তে একটি সাধারণ নাম ব্যবহার করা হয়েছিল এবং ডাটাবেস ফাইলের সমাধান করা পথটি অ্যাপের ডেটা ডিরেক্টরিতে অবস্থিত হবে না। ( I83315 , b/377830104 )
- রুম গ্রেডল প্লাগইনের সাথে একটি সমস্যা সমাধান করুন যেখানে স্কিমা ইনপুট এবং আউটপুট কনফিগার করার ফলে অ্যান্ড্রয়েড প্রোজেক্টে সমস্যা দেখা দিয়েছে:
property 'inputDirectory' is final and cannot be changed any further.
( 1dbb4c , b/376071291 ) - রুম গ্রেডল প্লাগইন-এ KSP2-এর জন্য সমর্থন যোগ করুন যেখানে প্লাগইন দ্বারা স্কিমা ডিরেক্টরি সঠিকভাবে সেট আপ করা হয়নি এমন একটি সমস্যা সমাধান করা। ( Iec3c4 , b/379159770 )
বাহ্যিক অবদান
-
Room
পেজিং ইন্টিগ্রেশনের সাথে একটি সমস্যা সমাধান করুন যার ফলে UI লাফ দেয় যখন রিফ্রেশ করার প্রাথমিক কী তালিকার শেষের খুব কাছাকাছি থাকে। ইভাকে ধন্যবাদ! ( I2abbe , b/389729367 )
সংস্করণ 2.7.0-alpha12
11 ডিসেম্বর, 2024
androidx.room:room-*:2.7.0-alpha12
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha12-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- পরীক্ষামূলক API
RoomDatabase.Builder.setInMemoryTrackingMode()
যোগ করুন রুম ইন-মেমরি টেবিল ব্যবহার করবে কি না অবৈধ ট্র্যাকিংয়ের জন্য কনফিগার করতে। ( I2a9b2 , b/185414040 )
বাগ ফিক্স
- ধ্বংসাত্মক মাইগ্রেশনগুলি এখন দৃশ্যগুলিকে ড্রপ করে যাতে সেগুলি পুনরায় তৈরি করা হয়, যখন এটি বন্ধ থাকে তখন বিদ্যমান আচরণের সাথে
allowDestructiveMigrationForAllTables
চালু (KMP ডিফল্ট) আচরণ সারিবদ্ধ করে৷ ( 0a3e83 , b/381518941 )
সংস্করণ 2.7.0-alpha11
অক্টোবর 30, 2024
androidx.room:room-*:2.7.0-alpha11
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha11-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- রুম-পেজিং এর জন্য একটি
RawRoomQuery
প্রাপ্ত একটি সাসপেন্ড ফাংশন হতে নতুন যোগ করাconvertRows()
পদ্ধতি স্বাক্ষরটি পুনরায় দেখুন। ( IE57b5 , b/369136627 )
বাগ ফিক্স
- রুম-পেজিং-এ সমস্যাটি সমাধান করা হয়েছে যেখানে
PagingSource
সাথে একযোগে@Relation
ব্যবহার করার সময় অবৈধ কোড তৈরি করা হচ্ছে।
সংস্করণ 2.7.0-alpha10
অক্টোবর 16, 2024
androidx.room:room-*:2.7.0-alpha10
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha10-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- অ-অ্যান্ড্রয়েড এবং নন-জেভিএম প্ল্যাটফর্মগুলিতে
ByteBuffer
সাথে সম্পর্ক সমর্থন করার জন্য অভ্যন্তরীণByteArrayWrapper
ক্লাস তৈরি করুন। ( I75543 , b/367205685 ) - একটি কলামের ডেটা টাইপ পুনরুদ্ধার সক্ষম করতে
SQLiteStatement.getColumnType()
এর সাথে বিভিন্নSQLITE_DATA_*
ফলাফলের ধ্রুবক যোগ করুন। ( I1985c , b/369636251 )
সংস্করণ 2.7.0-alpha09
2 অক্টোবর, 2024
androidx.room:room-*:2.7.0-alpha09
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha09-এ এই কমিট রয়েছে।
বাগ ফিক্স
-
room-paging
এর KMP বাস্তবায়নের সাথে একটি সমস্যা সমাধান করুন যা একটিError code: 8, message: attempt to write a readonly database
৷ ( b/368380988 )
সংস্করণ 2.7.0-alpha08
18 সেপ্টেম্বর, 2024
androidx.room:room-*:2.7.0-alpha08
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha08-এ এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
-
room-paging
আর্টিফ্যাক্টগুলি কেএমপি সামঞ্জস্যপূর্ণ হতে স্থানান্তরিত করা হয়েছে। ( Ib8756 , b/339934824 ) - API
invalidationTrackerFlow()
একটি প্রথম পক্ষের API হিসাবেInvalidationTracker.createFlow()
হিসাবে প্রচলিত হয়েছে এবং এখন KMP প্রকল্পগুলিতে নন-অ্যান্ড্রয়েড সোর্স সেটগুলির জন্য উপলব্ধ৷ ( I1fbfa , ( I8fb29 ), b/329291639 , b/329315924 )
এপিআই পরিবর্তন
- রুমের সমস্ত সতর্কতা এবং ত্রুটি বার্তাগুলি যেগুলি
Cursor
শব্দটি ব্যবহার করে সেগুলি সরিয়ে দেওয়া হয়েছে বা প্রতিস্থাপন করা হয়েছে, কারণCursor
রুমের KMP সংস্করণে ব্যবহারের জন্য একটি সঠিক সাধারণ শব্দ নয়৷ ( Id8cd9 , b/334087492 )
বাগ ফিক্স
- একটি সমস্যা সমাধান করা হয়েছে যেখানে রুম KMP নন-JVM প্ল্যাটফর্মের জন্য
UUID
ব্যবহার করে কোড নির্গত করার চেষ্টা করবে। ( b/362994709 ) - রুম গ্র্যাডল প্লাগইনের সাথে একটি সমস্যা সমাধান করা হয়েছে যা কম্পোজ মাল্টিপ্ল্যাটফর্ম সহ একটি KMP প্রকল্পে ব্যবহার করার সময় 'কনফিগারেশনের বৈশিষ্ট্যগুলি পরিবর্তন করতে পারে না ... মিউটেশনের জন্য লক করার পরে' এর মতো একটি ত্রুটি সৃষ্টি করবে৷ ( b/343408758 )
সংস্করণ 2.7.0-alpha07
আগস্ট 21, 2024
androidx.room:room-*:2.7.0-alpha07
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha07-এ এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
- রুম গ্রেডল প্লাগইন এখন স্বয়ংক্রিয়ভাবে রপ্তানিকৃত স্কিমাগুলিকে Android ইন্সট্রুমেন্টেশন টেস্ট রিসোর্স সোর্সে যুক্ত করবে যাতে সেগুলি
MigrationTestHelper
দ্বারা ব্যবহার করা যায়৷
বাগ ফিক্স
-
RoomDatabaseConstructor
জেনারেট করা 'প্রকৃত' এর সাথে একটি সমস্যা সমাধান করা হয়েছে যদিinitialize
ফাংশনে 'প্রকৃত' মডিফায়ার অনুপস্থিত থাকে যদি এই ধরনের ফাংশনটি 'প্রত্যাশিত' ঘোষণাতেও ওভাররাইড করা হয়। ( 359631627 ) - 'প্রত্যাশিত' ঘোষণার দৃশ্যমানতার সাথে মেলে না
RoomDatabaseConstructor
জেনারেট করা 'প্রকৃত' নিয়ে একটি সমস্যা সমাধান করা হয়েছে। ( 358138953 )
সংস্করণ 2.7.0-alpha06
7 আগস্ট, 2024
androidx.room:room-*:2.7.0-alpha06
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha06-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
- একটি KMP প্রকল্পে একটি
RoomDatabase
জন্য ইনস্ট্যান্টেশন সেটআপ পরিবর্তন করুন।
Kotlin 2.0 কম্পাইলেশন মডেলের কারণে, instantiateImpl()
নামে একটি তৈরি করা ফাংশন উল্লেখ করার কৌশলটি আর কার্যকর। দুটি নতুন API, @ConstructedBy
এবং RoomDatabaseConstructor
চালু করা হয়েছে যা instantiateImpl()
কৌশল প্রতিস্থাপন করে। নতুন কৌশল নিম্নরূপ:
RoomDatabaseConstructor
প্রয়োগ করে এমন একটি প্রত্যাশার বস্তুর সংজ্ঞা দিনexpect object MyDatabaseCtor : RoomDatabaseConstructor<MyDatabase>
@ConstructedBy
ব্যবহার করে@Database
ঘোষণার সাথে বস্তুটিকে লিঙ্ক করুন@Database(...) @ConstructedBy(MyDatabaseCtor::class) // NEW abstract class MyDatabase : RoomDatabase
একটি নতুন ডাটাবেস উদাহরণ তৈরি করুন কিন্তু একটি কারখানা যুক্তি পাস না করে
fun createNewDatabase(path: String) = Room.databaseBuilder<AppDatabase>(name = path) .setDriver(BundledSQLiteDriver()) .setQueryCoroutineContext(Dispatchers.IO) .build()
b/316978491 , b/338446862 , এবং b/342905180 সংশোধন করে
-
RoomRawQuery
নামক একটি নতুন API যোগ করে রুম KMP-তে@RawQuery
এর জন্য সমর্থন যা কাঁচা SQL স্ট্রিং এবং একটি বিবৃতিতে আর্গুমেন্ট আবদ্ধ করার জন্য একটি ফাংশন ধরে রাখার ক্ষেত্রেSupportSQLiteQuery
এর মতো।@RawQuery
টীকাযুক্ত ফাংশন এখন একটিRoomRawQuery
তাদের একক প্যারামিটার হিসাবে গ্রহণ করতে পারে। ( Iea844 , b/330586815 ) -
setQueryCallback()
এর একটি ওভারলোড যোগ করুন যা একটিCoroutineContext
গ্রহণ করে। ( Id66ff , b/309996304 ) -
linuxArm64
Kotlin মাল্টিপ্ল্যাটফর্ম লক্ষ্যগুলির জন্য সমর্থন যোগ করা হয়েছে ( I139d3 , b/338268719 )
বাগ ফিক্স
- একটি সমস্যা সমাধান করুন যেখানে রুম ভুলভাবে নন-অ্যান্ড্রয়েড টার্গেটে
recursiveFetchArrayMap
একটি কল তৈরি করবে। ( 710c36 , b/352482325 ) - একটি সমস্যা সমাধান করুন যেখানে কখনও কখনও রুম একটি কেএমপি প্রকল্পে 'সংযোগের চেষ্টা করার সময় শেষ' সম্পর্কে একটি ব্যতিক্রম ছুঁড়ে দেয়। ( fa72d0 , b/347737870 )
- অটো-মাইগ্রেশনে এমন একটি সমস্যা সমাধান করুন যা নতুন বিদেশী কীগুলির সাথে সামঞ্জস্য করার জন্য অন্যান্য টেবিলগুলি তাদের স্কিমা পরিবর্তন করার আগে খুব তাড়াতাড়ি বিদেশী কীগুলির জন্য পরীক্ষা করবে৷ ( 7672c0 , b/352085724 )
সংস্করণ 2.7.0-alpha05
10 জুলাই, 2024
androidx.room:room-*:2.7.0-alpha05
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha05-এ এই কমিট রয়েছে।
এপিআই পরিবর্তন
-
SQLiteKt
থেকেSQLite
এবংBundledSQLiteKt
থেকেBundledSQLite
নামকরণ করা হয়েছে। ( I8b501 )
বাগ ফিক্স
- একটি বাগ সংশোধন করা হয়েছে যেখানে
AndroidSQLiteDriver
ব্যবহার করার সময় একটিRoomDatabase
বন্ধ হয়ে যাবে বা সংযোগের সময়সীমার সাথে ত্রুটি হয়ে যাবে।
সংস্করণ 2.7.0-alpha04
জুন 12, 2024
androidx.room:room-*:2.7.0-alpha04
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha04-এ এই কমিট রয়েছে।
বাগ ফিক্স
- রুমের টীকা প্রসেসরে একটি সমস্যা সমাধান করা হলে একটি DAO-তে বহু-মানচিত্র রিটার্ন টাইপ সংজ্ঞায়িত করা হলে বেমানান KMP কোড তৈরি হবে। ( b/340983093 )
- একটি সমস্যা সমাধান করা হয়েছে যেখানে রুম জেনারেট করা ডাটাবেস বাস্তবায়ন খুঁজে পেতে ব্যর্থ হবে যদি
@Database
টীকাযুক্ত ক্লাসের কোনো প্যাকেজ না থাকে। ( b/342097292 ) - একটি সমস্যা সমাধান করা হয়েছে যেখানে অটো-ক্লোজ এবং মাল্টি-ইনস্ট্যান্স ইনভালিডেশন সক্ষম করার ফলে কখনও কখনও একটি
ConcurrentModificationException
ঘটবে যখন নিষ্ক্রিয় থাকার কারণে ডাটাবেসটি স্বয়ংক্রিয়ভাবে বন্ধ হয়ে যায়।
সংস্করণ 2.7.0-alpha03
29 মে, 2024
androidx.room:room-*:2.7.0-alpha03
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha03-এ এই কমিট রয়েছে।
বাগ ফিক্স
- Kotlin 2.0 এবং KSP 2.0 সংক্রান্ত বিভিন্ন সমস্যা সমাধান করুন। নোট করুন যে KSP 2 সমর্থন সহ Kotlin 2.0 সম্পূর্ণ নয় এবং দলটি নতুন কম্পাইলারে বিভিন্ন API এবং আচরণের পরিবর্তন নিয়ে কাজ করছে। ( b/314151707 )
সংস্করণ 2.7.0-alpha02
14 মে, 2024
androidx.room:room-*:2.7.0-alpha02
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha02-এ এই কমিট রয়েছে।
বাগ ফিক্স
- বিভিন্ন KSP সমস্যা সংশোধন করা হয়েছে।
সংস্করণ 2.7.0-alpha01
1 মে, 2024
androidx.room:room-*:2.7.0-alpha01
প্রকাশিত হয়েছে। সংস্করণ 2.7.0-alpha01-এ এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
- কোটলিন মাল্টিপ্ল্যাটফর্ম (কেএমপি) সমর্থন : এই রিলিজে, রুমটিকে কোটলিন মাল্টিপ্ল্যাটফর্ম (কেএমপি) লাইব্রেরিতে পরিণত করার জন্য রিফ্যাক্টর করা হয়েছে। যদিও এখনও কিছু কাজ করা বাকি আছে, এই রিলিজটি রুমের একটি নতুন সংস্করণ প্রবর্তন করে যেখানে বেশিরভাগ কার্যকারিতা "সাধারণ-কৃত" (মাল্টিপ্ল্যাটফর্ম হতে তৈরি) করা হয়েছে। বর্তমান সমর্থিত প্ল্যাটফর্মগুলি হল অ্যান্ড্রয়েড, আইওএস, জেভিএম (ডেস্কটপ), নেটিভ ম্যাক এবং নেটিভ লিনাক্স। নতুন সমর্থিত প্ল্যাটফর্মগুলিতে অনুপস্থিত কার্যকারিতা আসন্ন রুম রিলিজে "বৈশিষ্ট্য-সম্পূর্ণ" করা হবে।
কিভাবে রুম KMP ব্যবহার শুরু করবেন সে সম্পর্কে আরও তথ্যের জন্য, অনুগ্রহ করে অফিসিয়াল রুম KMP ডকুমেন্টেশন দেখুন।
- KSP-তে Kotlin কোড জেনারেশন ডিফল্টরূপে চালু করা হয়েছে যদি KSP-এর মাধ্যমে প্রক্রিয়াকরণ করা হয়। KAPT বা জাভা শুধুমাত্র প্রকল্পগুলির জন্য, রুম এখনও জাভা উত্স তৈরি করবে।
এপিআই পরিবর্তন
-
Room.databaseBuilder()
এর একটি ওভারলোড যুক্ত করা হয়েছে যা একটি ল্যাম্বডা প্যারামিটার নেয় যা একটি রুম জেনারেটেড ফাংশনের সাথে ব্যবহার করা হয় যাতে জেনারেট করাRoomDatabase
বাস্তবায়নকে ইনস্ট্যান্টিয়েট করার সময় প্রতিফলন ব্যবহার করা এড়ানো যায়। উদাহরণ ব্যবহার হল:
Room.databaseBuilder<MyDatabase>(
context = appContext,
name = dbFilePath,
factory = { MyDatabase::class.instantiateImpl() }
)
- একটি
CoroutineContext
সহ একটি রুম কনফিগার করার জন্য একটি API বিল্ডারে যোগ করা হয়েছে:RoomDatabase.Builder.setQueryCoroutineContext
। মনে রাখবেন যে একটিRoomDatabase
শুধুমাত্রsetQueryExecutor
ব্যবহার করে নির্বাহকদের সাথে বা একটি Coroutine প্রসঙ্গের সাথে কনফিগার করা যেতে পারে তবে উভয়ই নয়। - একটি
SQLite
ড্রাইভারের সাথে রুম কনফিগার করার জন্য একটি API যোগ করা হয়েছে:RoomDatabase.Builder.setDriver()
।SQLite
Driver API সম্পর্কে আরও তথ্যের জন্য SQLite KMP ডকুমেন্টেশন পড়ুন - ড্রাইভার API গুলি থেকে অন্তর্নিহিত
SQLiteConnection
অ্যাক্সেস করার জন্য API যোগ করা হয়েছে:RoomDatabase.useReaderConnection
এবংRoomDatabase.useWriterConnection
। - Varios রুম সম্পর্কিত কলব্যাকগুলির এখন একটি ওভারলোডেড সংস্করণ রয়েছে যা
SupportSQLiteDatabase
পরিবর্তেSQLiteConnection
গ্রহণ করে। একটি KMP প্রকল্পে স্থানান্তরিত করার সময় এগুলি ওভাররাইড করার উদ্দেশ্যে করা হয়৷ একটি সাধারণ KMP মডিউলে একটি Android অ্যাপে রুম ব্যবহার স্থানান্তরিত করার বিষয়ে আরও তথ্যের জন্য মাইগ্রেশন গাইড পড়ুন। কলব্যাকগুলি হল:-
Migration.migrate(SQLiteConnection)
-
AutoMigrationSpec.onPostMigrate(SQLiteConnection)
-
RoomDatabase.Callback.onCreate(SQLiteConnection)
-
RoomDatabase.Callback.onDestructiveMigration(SQLiteConnection)
-
RoomDatabase.Callback.onOpen(SQLiteConnection)
-
- KTX আর্টিফ্যাক্ট
androidx.room:room-ktx
এর সমস্ত API সহandroidx.room:room-runtime
এ মার্জ করা হয়েছে, আর্টিফ্যাক্টটি এখন খালি। আপনার নির্ভরতা তালিকা থেকে এটি সরান.
সংস্করণ 2.6
সংস্করণ 2.6.1
নভেম্বর 29, 2023
androidx.room:room-*:2.6.1
প্রকাশিত হয়েছে। সংস্করণ 2.6.1-এ এই কমিট রয়েছে।
বাগ ফিক্স
- জেনারেট করা কোডে সমস্যা সমাধান করা হয়েছে যেখানে
EntityCursorConverter
এ ডাবল কলামের ডিফল্ট মান 0.0-এর পরিবর্তে 0-এ সেট করা হয়েছে। ফ্লোট টাইপ কলামের জন্য অনুরূপ এজ-কেসের জন্য একটি সম্ভাব্য সমাধানও অন্তর্ভুক্ত করা হয়েছে। ( Id75f5 , b/304584179 ) -
PagingSource
লোডগুলি থেকে নিক্ষিপ্ত ব্যতিক্রমগুলি এখনLoadResult.Error
এর একটিLoadStateUpdate
হিসাবে প্রচার করা হবে৷ নিক্ষেপযোগ্য ধারণ করা ত্রুটি৷ এই ত্রুটি অবস্থাPagingDataAdapter.loadStateFlow(Views)
বাLazyPagingItems.loadState(Compose)
এর মাধ্যমে পর্যবেক্ষণযোগ্য। মনে রাখবেন যে এটি একটি আচরণগত পরিবর্তনকে চিহ্নিত করে যেখানে অতীতে লোড ত্রুটিগুলি ডাও পদ্ধতি দ্বারা নিক্ষিপ্ত একটি ব্যতিক্রম হিসাবে বুদবুদ হবে যা লোডকে ট্রিগার করেছিল। ( I93887 , b/302708983 )
সংস্করণ 2.6.0
18 অক্টোবর, 2023
androidx.room:room-*:2.6.0
প্রকাশিত হয়েছে। সংস্করণ 2.6.0 এই কমিট ধারণ করে.
2.5.0 থেকে গুরুত্বপূর্ণ পরিবর্তন
- কোটলিন কোড জেনারেশন (বা "কোটলিন কোডজেন") সক্ষম করার বিকল্পটি এখন রুম কেএসপি-তে উপলব্ধ। ( 4297ec0 )। রুমে Kotlin CodeGen চালু করতে, KSP-এর জন্য আপনার প্রসেসরের বিকল্পগুলিতে
room.generateKotlin
বিকল্পের নাম যোগ করুন। KSP-এর জন্য প্রসেসর বিকল্পগুলি কীভাবে পাস করবেন সে সম্পর্কে আরও বিশদ বিবরণের জন্য, KSP ডকুমেন্টেশন দেখুন।
দ্রষ্টব্য: Kotlin CodeGen ব্যবহার করার সময়, এটি উল্লেখ করা গুরুত্বপূর্ণ যে অতিরিক্ত বিধিনিষেধ যোগ করা হয়েছে। Kotlin CodeGen-এ DAO গেটার বা DAO কোয়েরি হিসাবে বিমূর্ত বৈশিষ্ট্যগুলিকে অনুমোদন দেওয়া হয়নি, এবং সম্পত্তির মান অপরিবর্তনীয় এবং একটি নির্দিষ্ট সঞ্চিত ফলাফল রয়েছে এমন মিথ্যা ধারণা এড়াতে ফাংশন হিসাবে পুনরায় লেখা হবে বলে আশা করা হচ্ছে। আরেকটি বিধিনিষেধ যা যোগ করা হয়েছে তা হল যে শূন্য সংগ্রহের রিটার্নের ধরন আর Kotlin CodeGen-এর রুমে অনুমোদিত নয়।
সতর্কতা: আপনি দেখতে পেতে পারেন যে আপনার প্রকল্পগুলি কোটলিন কোডজেন ব্যবহার করার সময় শূন্যতার ক্ষেত্রে আরও কঠোর। কোটলিন কোডজেনে, টাইপ আর্গুমেন্টের শূন্যতা গুরুত্বপূর্ণ, যেখানে জাভাতে এটি বেশিরভাগই উপেক্ষা করা হয়। উদাহরণস্বরূপ, ধরা যাক আপনার একটি `প্রবাহ আছে
- Room Gradle Plugin-এর জন্য নতুন আর্টিফ্যাক্টটি
androidx.room
আইডি সহ রুমে যোগ করা হয়েছে, যা Gradle টীকা প্রসেসর বিকল্পের মাধ্যমে স্কিমাগুলির ইনপুট এবং আউটপুট থাকার বিষয়ে রুমের বিদ্যমান বিভিন্ন সমস্যার সমাধান করে। আরো বিস্তারিত জানার জন্য, রুম সংস্করণ 2.6.0-alpha02 রিলিজ নোট পড়ুন। - রুম সত্তার মান ক্লাস এখন KSP-এর জন্য সমর্থিত। ( 4194095 )
- DAO ফাংশনে নেস্টেড ম্যাপ রিটার্নের ধরন এখন রুমে সমর্থিত। ( I13f48 , 203008711 )
সংস্করণ 2.6.0-rc01
20 সেপ্টেম্বর, 2023
androidx.room:room-*:2.6.0-rc01
প্রকাশিত হয়েছে। সংস্করণ 2.6.0-rc01-এ এই কমিট রয়েছে।
সংস্করণ 2.6.0-beta01
23 আগস্ট, 2023
androidx.room:room-*:2.6.0-beta01
প্রকাশিত হয়েছে। সংস্করণ 2.6.0-beta01-এ এই কমিট রয়েছে।
বাগ ফিক্স
-
2067 SQLITE_CONSTRAINT_UNIQUE
ব্যতিক্রম একটি আপসার্টের সময় নিক্ষেপ করা হলে আপসার্টের সময় বিশেষ ক্ষেত্রেSQLite
ব্যতিক্রমটি পরিচালনা করা, আপসার্ট একটি আপডেট সম্পাদন করা উচিত। ( if2849 , b/243039555 )
সংস্করণ 2.6.0-alpha03
9 আগস্ট, 2023
androidx.room:room-*:2.6.0-alpha03
প্রকাশিত হয়েছে। সংস্করণ 2.6.0-alpha03 এই কমিট ধারণ করে।
নতুন বৈশিষ্ট্য
এপিআই পরিবর্তন
-
@MapInfo
প্রতিস্থাপন করতে@MapColumn
নামে একটি নতুন ধরনের টীকা তৈরি করা হয়েছে, যা এখন অবমূল্যায়িত হয়েছে। একটি@MapInfo
টীকায় প্রদত্ত প্রতিটি কলাম নামের (keyColumnName
,valueColumnName
, বা উভয়) জন্য, আপনাকে শুধুমাত্রcolumnName
সহ একটি@MapColumn
টীকা ঘোষণা করতে হবে এবং রিটার্ন DAO-এ ফাংশনের কী বা মান উল্লেখ করা নির্দিষ্ট টাইপ আর্গুমেন্টে টীকাটি ব্যবহার করতে হবে। এর কারণ হল@MapColumn
টীকাটি@MapInfo
এর মতো ফাংশনের পরিবর্তে DAO ফাংশনের রিটার্ন টাইপের মধ্যে টাইপ আর্গুমেন্টে সরাসরি ব্যবহার করা হয়। আরও তথ্যের জন্য, অনুগ্রহ করে@MapColumn
ডকুমেন্টেশন দেখুন। ( Ib0305 , b/203008711 ) - কম্প্যাটিবিলিটি সাপ্রেশন ( I8e87a , b/287516207 ) টীকা করতে API ফাইল আপডেট করা হয়েছে
- Room Gradle প্লাগইন API গুলি আপডেট করা হয়েছে যাতে সবসময় প্রতি-ভেরিয়েন্ট কনফিগারেশনের প্রয়োজন হয় না। এর মানে হল যে প্লাগইনটি একাধিক ডিরেক্টরি তৈরি না করেই সমস্ত ভেরিয়েন্টের জন্য একটি বিশ্বব্যাপী অবস্থান গ্রহণ করতে পারে, মসৃণ স্থানান্তর সক্ষম করে যা প্লাগইনের সুবিধাগুলি (পুনরুত্পাদনযোগ্য এবং ক্যাশেযোগ্য বিল্ড) বজায় রেখে ম্যানুয়ালি ফ্লেভার কনফিগার করতে বা টাইপ স্কিমা তৈরি করতে যথেষ্ট নমনীয়। ( I09d6f , b/278266663 )
বাগ ফিক্স
-
QueryInterceptorStatement
এ স্থির সম্ভাব্য মেমরি লিক দুর্বলতা। ( I193d1 ) -
QueryInterceptorDatabase execSQL()
ফাংশনে ভুল আচরণ সংশোধন করা হয়েছে। ( Iefdc8 )
সংস্করণ 2.6.0-alpha02
জুন 21, 2023
androidx.room:room-*:2.6.0-alpha02
প্রকাশিত হয়েছে। সংস্করণ 2.6.0-alpha02 এই কমিট ধারণ করে।
রুম গ্রেডল প্লাগইন
এই নতুন রিলিজে androidx.room
আইডি সহ রুম গ্রেডল প্লাগইন-এর জন্য একটি নতুন আর্টিফ্যাক্ট রয়েছে, যা গ্র্যাডল টীকা প্রসেসর বিকল্পের মাধ্যমে স্কিমাগুলির ইনপুট এবং আউটপুট থাকার বিষয়ে রুমের বিদ্যমান বিভিন্ন সমস্যার সমাধান করে। রুম গ্রেডল প্লাগইন প্রকল্পটিকে এমনভাবে কনফিগার করে যে তৈরি করা স্কিমাগুলি যা স্বয়ং-মাইগ্রেশনের জন্য ব্যবহার করা হয় এবং কম্পাইল টাস্কগুলির আউটপুট পুনরুত্পাদনযোগ্য এবং ক্যাশেযোগ্য বিল্ডের জন্য সঠিকভাবে কনফিগার করা হয়। প্লাগইনটি বেস স্কিমা অবস্থান কনফিগার করতে একটি DSL অফার করে:
room {
schemaDirectory("$projectDir/schemas/")
}
প্লাগইনটি তারপর রুম কম্পাইলার এবং বিভিন্ন কম্পাইল কাজ এবং এর ব্যাকএন্ডগুলি (javac, KAPT, KSP) স্কিম ফাইলগুলিকে স্বাদযুক্ত ফোল্ডারে আউটপুট করতে কনফিগার করবে, যেমন schemas/flavorOneDebug/com.package.MyDatabase/1.json
। যথারীতি এই ফাইলগুলি যাচাইকরণ এবং স্বয়ংক্রিয় স্থানান্তরের জন্য ব্যবহার করার জন্য সংগ্রহস্থলে চেক-ইন করা হয়। টীকা প্রসেসর বিকল্পের পরিবর্তে প্লাগইন ব্যবহার করার জন্য স্থানান্তরিত করার পরে, বিদ্যমান স্কিমা ফাইলগুলি প্লাগইন দ্বারা তৈরি করা ফ্লেভার ডিরেক্টরিগুলিতে অনুলিপি করা আবশ্যক, এটি একটি এককালীন মাইগ্রেশন অপারেশন যা ম্যানুয়ালি করা আবশ্যক৷ বিকাশকারী.android.com- এর স্কিমা ডকুমেন্টেশন ভবিষ্যতে আপডেট করা হবে একবার ফিডব্যাকের সমাধান হয়ে গেলে এবং প্লাগইনটি স্থিতিশীল হয়ে গেলে, তাই দয়া করে একবার চেষ্টা করুন৷
এপিআই পরিবর্তন
- SAM রূপান্তর ব্যবহারের অনুমতি দেওয়ার জন্য
RoomDatabase.QueryCallback
একটি কার্যকরী ইন্টারফেস হিসাবে সংজ্ঞায়িত করা হয়েছে। ( Iab8ea , b/281008549 )
বাগ ফিক্স
- জাভা থেকে কোটলিনে রুম সোর্স স্থানান্তরের পরে রোবোলেক্ট্রিক-এ ডাটাবেস ইনস্ট্যান্ট করার সময় উদ্ভূত সমস্যার সমাধান করা। ( Ic053c , b/274924903 )
সংস্করণ 2.6.0-alpha01
22 মার্চ, 2023
androidx.room:room-*:2.6.0-alpha01
প্রকাশিত হয়েছে। 2.6.0-alpha01 সংস্করণে এই কমিট রয়েছে।
নতুন বৈশিষ্ট্য
- KSP-এর জন্য রুমে সাপোর্টিং ভ্যালু ক্লাস। রুম এখন সত্তার মান ক্লাস সমর্থন করতে সক্ষম. ( 4194095 )
- কোটলিন কোড জেনারেশন (বা "কোটলিন কোডজেন") এখন রুমে সক্ষম করা যেতে পারে ( 4297ec0 )। রুমে Kotlin CodeGen চালু করতে, KSP-এর জন্য আপনার প্রসেসরের বিকল্পগুলিতে
room.generateKotlin
বিকল্পের নাম যোগ করুন। KSP-এর জন্য প্রসেসর বিকল্পগুলি কীভাবে পাস করবেন সে সম্পর্কে আরও বিশদ বিবরণের জন্য, KSP ডকুমেন্টেশন দেখুন।
দ্রষ্টব্য: Kotlin CodeGen ব্যবহার করার সময়, এটি উল্লেখ করা গুরুত্বপূর্ণ যে অতিরিক্ত বিধিনিষেধ যোগ করা হয়েছে। Kotlin CodeGen-এ DAO গেটার বা DAO কোয়েরি হিসাবে বিমূর্ত বৈশিষ্ট্যগুলিকে অনুমোদন দেওয়া হয়নি, এবং সম্পত্তির মান অপরিবর্তনীয় এবং একটি নির্দিষ্ট সঞ্চিত ফলাফল রয়েছে এমন মিথ্যা ধারণা এড়াতে ফাংশন হিসাবে পুনরায় লেখা হবে বলে আশা করা হচ্ছে। আরেকটি বিধিনিষেধ যা যোগ করা হয়েছে তা হল যে শূন্য সংগ্রহের রিটার্নের ধরন আর Kotlin CodeGen-এর রুমে অনুমোদিত নয়।
সতর্কতা: আপনি দেখতে পেতে পারেন যে আপনার প্রকল্পগুলি কোটলিন কোডজেন ব্যবহার করার সময় শূন্যতার ক্ষেত্রে আরও কঠোর। কোটলিন কোডজেনে, টাইপ আর্গুমেন্টের শূন্যতা গুরুত্বপূর্ণ, যেখানে জাভাতে এটি বেশিরভাগই উপেক্ষা করা হয়। উদাহরণস্বরূপ, ধরা যাক আপনার একটি `প্রবাহ আছে
এপিআই পরিবর্তন
- DAO পদ্ধতি রিটার্ন প্রকারে বাতিলযোগ্য সংগ্রহের অর্থহীন ব্যবহারের বিরুদ্ধে রক্ষা করা। ( I777dc , b/253271782 , b/259426907 )
- একটি ফ্লো তৈরি করার জন্য একটি API যোগ করুন যা অবৈধ ট্র্যাকার পরিবর্তনগুলি নির্গত করে। এপিআই এমন স্ট্রীম তৈরি করার জন্য উপযোগী যা ডাটাবেস পরিবর্তনের প্রতিক্রিয়া জানাতে হবে। ( I8c790 , b/252899305 )
বাগ ফিক্স
- কোটলিন কোডজেনে DAO গেটার বা DAO কোয়েরি হিসাবে বিমূর্ত বৈশিষ্ট্যগুলিকে অস্বীকৃতি দিন, পরিবর্তে সম্পত্তির মান অপরিবর্তনীয় এবং একটি নির্দিষ্ট সঞ্চিত ফলাফল রয়েছে এমন মিথ্যা ধারণা এড়াতে তাদের ফাংশন হিসাবে পুনরায় লেখা উচিত। ( if6a13 , b/127483380 , b/257967987 )
সংস্করণ 2.5.2
সংস্করণ 2.5.2
জুন 21, 2023
androidx.room:room-*:2.5.2
প্রকাশিত হয়েছে। সংস্করণ 2.5.2 এই কমিট ধারণ করে.
বাগ ফিক্স
- kotlinx-metadata-jvm-এর সাথে একটি অসঙ্গতি সমস্যা সমাধান করুন। ( 386d5c )
- রোবোলেক্ট্রিক পরীক্ষায় ব্যবহার করার সময় রুম একটি ত্রুটি নিক্ষেপের কারণ একটি সমস্যা সমাধান করুন। ( f79bea , b/274924903 )
সংস্করণ 2.5.1
সংস্করণ 2.5.1
22 মার্চ, 2023
androidx.room:room-*:2.5.1
প্রকাশিত হয়েছে। সংস্করণ 2.5.1 এই কমিট ধারণ করে.
বাগ ফিক্স
- ডাটাবেস ইতিমধ্যে খোলা থাকলে
FrameworkSQLiteHelper
এ ডাটাবেস প্যারেন্ট ডিরেক্টরি পরীক্ষা করা এড়িয়ে চলুন। ( 5de86b8 ) - ডাটাবেস ইতিমধ্যে খোলা আছে কিনা তা পরীক্ষা করার সময় একটি
isOpenInternal
চেক ব্যবহার করুন। ( e91fb35 ) -
Room
এরacquireTransactionThread()
এ পুনরায় প্রবেশকারী মামলার আরও ভাল পরিচালনা এখন উপলব্ধ। ( 219f98b )। একটি স্থগিত লেনদেনের সময়, রুম লেনদেন নির্বাহক থেকে একটি থ্রেড ব্যবহার করে, এটিতে একটি ইভেন্ট লুপ শুরু করে এবং এতে ডাটাবেস ক্রিয়াকলাপ স্থগিত করে পাঠায় যাতে সেগুলি লেনদেন করোটিনের মধ্যে অন্তর্ভুক্ত থাকে। এটি সাধারণত প্রত্যাশিত হয় যে লেনদেন থ্রেড লেনদেন শুরু করার থেকে আলাদা, কিন্তু কিছু ক্ষেত্রে তারা একই। এই ধরনের পুনঃপ্রবেশকারী কেসগুলি পরিচালনা করার জন্যwithTransaction()
কে রিফ্যাক্টর করা হয়েছে যাতে আর কোনো নিয়ন্ত্রণ কাজের উপর নির্ভর না করা যায় এবং এর পরিবর্তে এটি লেনদেনের থ্রেডেrunBlocking
মধ্যে থেকে সাসপেন্ডিং লেনদেন ব্লকটি কার্যকর করবে।
সংস্করণ 2.5.0
সংস্করণ 2.5.0
22 ফেব্রুয়ারি, 2023
androidx.room:room-paging-guava:2.5.0
, androidx.room:room-paging-rxjava2:2.5.0
, এবং androidx.room:room-paging-rxjava3:2.5.0
প্রকাশিত হয়েছে। সংস্করণ 2.5.0 এই কমিট ধারণ করে.
সংস্করণ 2.5.0
11 জানুয়ারী, 2023
androidx.room:room-*:2.5.0
প্রকাশিত হয়েছে। সংস্করণ 2.5.0 এই কমিট ধারণ করে.
2.4.0 থেকে গুরুত্বপূর্ণ পরিবর্তন
- সমস্ত
room-runtime
উত্স জাভা থেকে কোটলিনে রূপান্তরিত করা হয়েছে। মনে রাখবেন যে লাইব্রেরি কোটলিনে রূপান্তরের কারণে আপনার কোডটি কোটলিনে থাকলে আপনি উৎসের অসঙ্গতি সমস্যার সম্মুখীন হতে পারেন। উদাহরণস্বরূপ, একটি পরিচিত উৎসের অসঙ্গতিপূর্ণ পরিবর্তন হল যেInvalidationTracker
এ আপনাকে এখনObserver
-এonInvalidate()
ঘোষণা করতে হবে যাতেMutableSet
নয়,Set
টাইপের একটি প্যারাম থাকে। অধিকন্তু, নির্দিষ্ট গেটার পদ্ধতিগুলিকে বৈশিষ্ট্যগুলিতে রূপান্তরিত করা হয়েছিল যার জন্য কোটলিন ফাইলগুলিতে সম্পত্তি অ্যাক্সেস সিনট্যাক্স প্রয়োজন। কোনো উল্লেখযোগ্য অসঙ্গতি থাকলে অনুগ্রহ করে একটি বাগ ফাইল করুন। - একটি নতুন শর্টকাট টীকা যোগ করা হয়েছে,
@Upsert
, যা একটি সত্তা সন্নিবেশ করার চেষ্টা করে যখন কোনো স্বতন্ত্রতার দ্বন্দ্ব থাকে না বা কোনো বিরোধ থাকলে সত্তা আপডেট করে। ( I7aaab , b/241964353 ) - New room-paging artifacts
room-paging-rxjava2
,room-paging-rxjava3
androom-paging-guava
have been added for support in Room Paging. - Added APIs for providing key and value tables names for disambiguation in
@MapInfo
( Icc4b5 )
Version 2.5.0-rc01
7 ডিসেম্বর, 2022
androidx.room:room-*:2.5.0-rc01
is released. Version 2.5.0-rc01 contains these commits.
- This release is identical to
2.5.0-beta02
.
Version 2.5.0-beta02
9 নভেম্বর, 2022
androidx.room:room-*:2.5.0-beta02
is released. Version 2.5.0-beta02 contains these commits.
এপিআই পরিবর্তন
- Fix various APIs that take query arguments from invariant (
Array<Any?>
) to contravariant (Array<out Any?>
) to match Java's array behavior. ( b/253531073 )
Version 2.5.0-beta01
5 অক্টোবর, 2022
androidx.room:room-*:2.5.0-beta01
is released. Version 2.5.0-beta01 contains these commits.
এপিআই পরিবর্তন
- Restrict the minimum version that supports
@Upsert
to be API 16. This is due to the inability to identity a primary key constraint conflict in older APIs. ( I5f67f , b/243039555 )
বাগ ফিক্স
- Fixed an issue where shadow tables where incorrectly exported to the schema
.json
files, corrupting them. ( I4f83b , b/246751839 )
Version 2.5.0-alpha03
24 আগস্ট, 2022
androidx.room:room-*:2.5.0-alpha03
is released. Version 2.5.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- Added a new shortcut annotation,
@Upsert
, which attempts to insert an entity when there is no uniqueness conflict or update the entity if there is a conflict. ( I7aaab , b/241964353 )
বাগ ফিক্স
- Room will now throw a
SQLiteConstraintException
instead of aIllegalStateException
during an auto-migration foreign key constraint check. ( I328dd ) - Fix a Kotlin source incompatible change for getter / properties of
getOpenHelper
,getQueryExecutor
andgetTransactionExecutor
. ( Iad0ac )
Version 2.5.0-alpha02
জুন 1, 2022
androidx.room:room-*:2.5.0-alpha02
is released. Version 2.5.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
- New
room-paging
artifactsroom-paging-rxjava2
,room-paging-rxjava3
androom-paging-guava
have been added for support in Room Paging.( 41a1d4 , b/203666906 ),( eb6098 , b/203666906 ),( 1b9ae4 , b/203666906 )
এপিআই পরিবর্তন
- All of
room-runtime
has been converted from Java to Kotlin. ( If2069 , b/206859668 ),( Ie4b55 , b/206859668 ), ( I697ee , b/206859668 ), ( I96c25 , b/206859668 )Note: You may encounter source incompatibility issues due to the library conversion to Kotlin. If your code was in Kotlin and calling the old version of Room, the new version will need to handle these cases. For example, a known source incompatible change is that in
InvalidationTracker
you will now need to declareonInvalidate()
inObserver
to have a param of typeSet
and notMutableSet
. - Added APIs for providing key and value tables names for disambiguation in
@MapInfo
( Icc4b5 ) - Fix a source compatibility issue to re-allow
@Ignore
in property getters. ( Ifc2fb )
বাগ ফিক্স
- Duplicate column resolution heuristic algorithm. Room will now attempt to resolve ambiguous columns in a multimap query. This allows for JOINs with tables containing same-name tables to be correctly mapped to a result data object. ( I4b444 , b/201306012 , b/212279118 )
Version 2.5.0-alpha01
23 ফেব্রুয়ারি, 2022
androidx.room:room-*:2.5.0-alpha01
is released. Version 2.5.0-alpha01 contains these commits.
এপিআই পরিবর্তন
- Fixed an issue where Room
@IntDef
usage were not being enforced in Kotlin sources. ( I75f41 , b/217951311 ) - Fixed a source compatibility issue to re-allow
@Query
in property getters. ( I0a09b ) - Converted room-common from Java to Kotlin. ( I69c48 , b/206858235 )
Note: You may encounter source incompatibility issues as some properties have been moved into companion objects during the library conversion to Kotlin. If your code was in Kotlin and calling the old version of Room, the new version will need the ".Companion" suffix when accessing these properties.
- Converted room-migration from Java to Kotlin. ( I2724b , b/206858622 )
- Converted
paging
related files inroom-runtime
from Java to Kotlin. ( I82fc8 , b/206859668 ) - Added API for multi-process lock and usage at the FrameworkSQLite* level, to protect multi-process 1st time database creation and migrations. ( Ied267 , b/193182592 )
বাগ ফিক্স
- Added support for internal properties in Kotlin sources. This is a slight behavior change in Room where it will use the source name of functions while matching them to properties as getters/setters (previously, it was using JVM name of the function which is different for internal functions/properties). If you are using custom
@JvmName
annotations to match getters/setters to private properties, please double check the generated code after the update ( If6531 , b/205289020 )
Version 2.4.3
Version 2.4.3
জুলাই 27, 2022
androidx.room:room-*:2.4.3
is released. Version 2.4.3 contains these commits.
বাগ ফিক্স
- Fixed an issue that would cause Room to not recognize suspend functions in Kotlin 1.7 ( b/236612358 )
সংস্করণ 2.4.2
সংস্করণ 2.4.2
23 ফেব্রুয়ারি, 2022
androidx.room:room-*:2.4.2
is released. Version 2.4.2 contains these commits.
বাগ ফিক্স
- Fix an issue generating code for a Dao
@Transaction
suspend function with a body that generates a default interface method due to compilation with-Xjvm-default=all
or equivalent. ( Ia4ce5 ) - Resolving a bug where Room generates code for a
Array<ByteArray>
return type query method. ( If086e , b/213789489 )
Version 2.4.1
Version 2.4.1
জানুয়ারী 12, 2022
androidx.room:room-*:2.4.1
is released. Version 2.4.1 contains these commits.
বাগ ফিক্স
- Added support for internal properties in Kotlin sources. This is a slight behavior change in Room where it will use the source name of functions while matching them to properties as getters/setters (previously, it was using JVM name of the function which is different for internal functions/properties). If you are using custom
@JvmName
annotations to match getters/setters to private properties, please double check the generated code after the update ( If6531 , b/205289020 )
সংস্করণ 2.4.0
সংস্করণ 2.4.0
15 ডিসেম্বর, 2021
androidx.room:room-*:2.4.0
is released. Version 2.4.0 contains these commits.
Important changes since 2.3.0
- Auto Migrations : Room now offers an API for automatically generating migrations as long as schemas are exported. To let Room know that it should generate an auto-migration a new property
@Database#autoMigrations
can be used to declare the versions to auto-migrate from and to. When Room needs additional information regarding tables and column renames or deletes, then the@AutoMigration
annotation can declare a specification class containing such inputs. See the@AutoMigration
documentation for more details. - Dependency Injection in Auto Migrations :
@ProvidedAutoMigrationSpec
is a new API for declaring that anAutoMigrationSpec
will be provided at runtime viaRoomDatabase.Builder#addAutoMigrationSpec()
. This allows for a dependency injection framework to provide such specs when they need complex dependencies. - Migration Test Helper Support for Auto Migrations : Room's
MigrationTestHelper
was updated to support auto migrations by providing a new constructor API that receives the database class under test. This allows the helper to automatically add auto migrations the same way duringrunMigrationsAndValidate
. - Room-Paging Support :
androidx.room:room-paging
is released, providing native Paging 3.0 support for Room queries returningandroidx.paging.PagingSource
. - Relational Query Methods : Room now supports multimap return types
@Dao
methods, useful for JOIN statements. The supported types of multimaps areMap
,SparseArray
,LongSparseArray
, along with Guava'sImmutableMap
,ImmutableSetMultimap
andImmutableListMultimap
.
Version 2.4.0-rc01
ডিসেম্বর 1, 2021
androidx.room:room-*:2.4.0-rc01
is released. Version 2.4.0-rc01 contains these commits.
নতুন বৈশিষ্ট্য
- Update Room's dependency on KSP to
1.6.0-1.0.1
to support Kotlin 1.6
Version 2.4.0-beta02
17 নভেম্বর, 2021
androidx.room:room-*:2.4.0-beta02
is released. Version 2.4.0-beta02 contains these commits.
নতুন বৈশিষ্ট্য
- We've added support for SparseArray and LongSparseArray in @MapInfo. ( Ic91a2 b/138910317 )
বাগ ফিক্স
- We've added a new TypeConverter analyzer that takes nullability information in types into account. As this information is only available in KSP, it is turned on by default only in KSP. If it causes any issues, you can turn it off by passing room.useNullAwareTypeAnalysis=false to the annotation processor. If that happens, please a file bug as this flag will be removed in the future. With this new TypeConverter analyzer, it is suggested to only provide non-null receiving TypeConverters as the new analyzer has the ability to wrap them with a null check. Note that this has no impact for users using KAPT or Java as the annotation processors (unlike KSP), don't have nullability information in types. ( Ia88f9 , b/193437407 )
- Fix a bug where Room would fail to compile with a SQL error when an FTS entity declared to use the ICU tokenizer. ( I00db9 , b/201753224 )
- Resolved issue in auto migrations regarding a new column added to an embedded Entity between versions. ( I5fcb1 b/193798291 )
- We have resolved an issue regarding the relational query method return types in LEFT JOIN queries. With these changes, in the case where a 1-many mapping is present, the collection returned for a key will not include the invalid value object if it is not found in the cursor. If no valid values are found, then a key will be mapped to an empty collection. ( Id5552 b/201946438 )
- Resolved the auto migration issue where SQLite keywords failed to be escaped in column names. ( Idbed4 b/197133152 )
Version 2.4.0-beta01
13 অক্টোবর, 2021
androidx.room:room-*:2.4.0-beta01
is released. Version 2.4.0-beta01 contains these commits.
বাগ ফিক্স
- Fixed an issue with auto-migrations not adding new columns when another table in the same auto-migration also had a new column with the same name. ( Ia5db5 , b/200818663 )
- The PagingSource implementation generated by room-paging now uses the
queryExecutor
passed throughRoomDatabase.Builder
, so it can be overridden, instead ofDispatchers.IO
previously. ( Iae259 )
Version 2.4.0-alpha05
সেপ্টেম্বর 29, 2021
androidx.room:room-*:2.4.0-alpha05
is released. Version 2.4.0-alpha05 contains these commits.
নতুন বৈশিষ্ট্য
- Added a built-in type converter for UUID . ( I671e8 , b/73132006 )
এপিআই পরিবর্তন
Added a new property to the TypeConverters annotation to let developers disable built-in Enum and UUID converters. By default, these converters are on but you can disable them for a certain scope, or for the whole database. See TypeConverters documentation for details. ( 36ae9e , b/195413406 )
Supporting non-POJO keys/values for Multimap return types in DAOs via the
@MapInfo
annotation. ( I4d704 )
@MapInfo
will be required when the key or value column of the map are from a single column. উদাহরণ দেখুন:
@MapInfo(valueColumn = "songCount")
@Query("""
SELECT *, COUNT(mSongId) as songCount
FROM Artist JOIN Song ON Artist.artistName = Song.artist
GROUP BY artistName
""")
fun getArtistAndSongCounts(): Map<Artist, Integer>
- Make
room-paging
a required artifact when using Paging3 with Room. ( Ieaffe )
বাগ ফিক্স
- Fix an issue where multimap queries results were not correctly ordered when the query contained an ORDER BY clause of a column from the map's key. ( I6b887 )
বাহ্যিক অবদান
- Added new API to specify index order in @Index. Thanks to Nikita Zhelonkin. ( I033fc )
Version 2.4.0-alpha04
জুলাই 21, 2021
androidx.room:room-*:2.4.0-alpha04
is released. Version 2.4.0-alpha04 contains these commits.
নতুন বৈশিষ্ট্য
Room now supports multimap return types
@Dao
methods, useful for JOIN statements. The supported types of multimaps areMap
along with Guava'sImmutableMap
,ImmutableSetMultimap
andImmutableListMultimap
.The following are examples of multimap queries:
One-to-One Relation Map
@Query("SELECT * FROM Song JOIN Artist ON Song.artistId = Artist.artistId") fun getSongAndArtist(): Map<Song, Artist>
One-to-Many Relation Map (Standard multimap)
@Query("SELECT * FROM Artist JOIN Album ON Artist.id = Album.artistId") fun getArtistAndAlbums(): Map<Artist, List<Album>>
The multimap result can also be wrapped in the supported async return types, such as
LiveData
, Rx'sObservable
, or coroutinesFlow
.
Room-Paging
androidx.room:room-paging
is released, providing native Paging 3.0 support for Room queries returningandroidx.paging.PagingSource
.@Dao interface UserDao { @Query("SELECT * FROM users ORDER BY id ASC") fun loadUsers(): PagingSource<Int, User> }
This artifact replaces the
androidx.paging.PagingSource
implementation generated by Room with one built on top of Paging 3.0 APIs. The new PagingSource implementation parses keys differently, so any key manually supplied to Room's PagingSource would need to account for this behavior change, including the initialKey passed via Pager's constructor. Pages will start loading from theKey
withKey
being the first loaded item. This deviates from existing behavior whereLoadParams.Refresh.Key
is treated as the user's scroll position and items are loaded both before and after the key.The artifact is optional and opting out will fallback to existing support for Paging 3.0 that was introduced in Room 2.3. However, this artifact will become non-optional in future release for those using Room with Paging 3.0. To opt-in, add the new room-paging artifact to your classpath. If you are using Gradle, you can add the following snippet to your build.gradle:
dependency { implementation("androidx.room:room-paging:2.4.0-alpha04") }
বাগ ফিক্স
- Fix an issue in auto migrations regarding handling foreign key violations. ( b/190113935 )
Version 2.4.0-alpha03
16 জুন, 2021
androidx.room:room-*:2.4.0-alpha03
is released. Version 2.4.0-alpha03 contains these commits.
এপিআই পরিবর্তন
- Update Room's
MigrationTestHelper
to support auto migrations by providing a new constructor API that receives the database class under test. This allows the helper to automatically add auto migrations the same way duringrunMigrationsAndValidate
.
বাগ ফিক্স
Fixed an issue with Room's SQLite native library to support Apple's M1 chips. ( b/174695268
Fixed an issue where Room would not error out when the return type of a @Transaction function was a Flow ( I56ddd , b/190075899 )
Fix an issue in auto migrations regarding indices. b/177673291
Dependency Updates
- Room's KSP support now depends on KSP
1.5.10-1.0.0-beta01
. ( 1ecb11 , b/160322705 )
Version 2.4.0-alpha02
5 মে, 2021
androidx.room:room-*:2.4.0-alpha02
is released. Version 2.4.0-alpha02 contains these commits.
এপিআই পরিবর্তন
-
@ProvidedAutoMigrationSpec
is a new API for declaring that anAutoMigrationSpec
will be provided at runtime viaRoomDatabase.Builder#addAutoMigrationSpec()
. This allows for a dependency injection framework to provide such specs when they need complex dependencies.
বাগ ফিক্স
- Fix an issue with auto migrations where
@DatabaseView
s where not being properly re-created.
বাহ্যিক অবদান
- Fix an issue in Room's
JournalMode.TRUNCATE
where theInvalidationTracker
callback was sometimes being invoked invalidly, too late, or not at all. Thanks toUli Bubenheimer | bubenheimer@users.noreply.github.com
( b/154040286 )
Version 2.4.0-alpha01
21 এপ্রিল, 2021
androidx.room:room-*:2.4.0-alpha01
is released. Version 2.4.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
- Auto Migrations : Room now offers an API for automatically generating migrations as long as schemas are exported. To let Room know that it should generate an auto-migration a new property
@Database#autoMigrations
can be used to declare the versions to auto-migrate from and to. When Room needs additional information regarding tables and column renames or deletes, then the@AutoMigration
annotation can declare a specification class containing such inputs. See the@AutoMigration
documentation for more details.
বাগ ফিক্স
- Fix an issue where
defaultValue
with extra parenthesis were being incorrectly validated by Room's schema validation. b/182284899
সংস্করণ 2.3.0
সংস্করণ 2.3.0
21 এপ্রিল, 2021
androidx.room:room-*:2.3.0
is released. Version 2.3.0 contains these commits.
Important changes since 2.2.0
- Built-in Enum Support : Room will now default to using an Enum to String and vice versa type converter if none is provided. If a type converter for an enum already exists, Room will prioritize using it over the default one.
- Query Callback : Room now offers a general callback API RoomDatabase.QueryCallback, for when queries are about to execute, which can be useful for logging in debug builds. The callback can be set via
RoomDatabase.Builder#setQueryCallback()
. - Pre-packaged Improvement : Room now has APIs for creating a database using a pre-packaged database read from an input stream. This allows for cases such as when the pre-package database is gzipped.
- Provided Type Converters : Room now has APIs for providing instances of type converters such that the app can control their initialization. To mark a type converter that will be provided to Room use the new annotation @ProvidedTypeConverter.
- RxJava3 Support : Room now supports RxJava3 types. Similar to RxJava2 you can declare DAO methods whose return type are Flowable, Single, Maybe and Completable. Additionally a new artifact
androidx.room:room-rxjava3
is available to support RxJava3. - Paging 3.0 Support : Room will now support generating implementations for
@Query
annotated methods whose return type isandroidx.paging.PagingSource
.
Version 2.3.0-rc01
24 মার্চ, 2021
androidx.room:room-*:2.3.0-rc01
is released. Version 2.3.0-rc01 contains these commits.
বাগ ফিক্স
- Fix an issue that prevented Coroutine Flow queries created by Room to be consumed in a suspending
withTransaction
block. ( I797bf )
Version 2.3.0-beta03
10 মার্চ, 2021
androidx.room:room-*:2.3.0-beta03
is released. Version 2.3.0-beta03 contains these commits.
নতুন বৈশিষ্ট্য
- Added incremental compilation support for KSP. ( I031c1 , b/176453350 )
বাগ ফিক্স
- Fixed a bug where creating PagingSource on the main thread could trigger an ANR. ( I42b74 , b/181221318 )
- Fixed
@ExperimentalRoomApi
visibility to be public instead of package private. ( b/181356119 )
বাহ্যিক অবদান
- Allow Room to accept a POJO return type in a
@Query
annotated DAO method when it is also annotated with@SkipQueryVerification
. Room will do a best-effort to convert the result of the query to the POJO return type the same way it is done for a@RawQuery
annotated DAO method. Thanks to 'Markus Riegel | hey@marcorei.com'. ( I45acb )
Version 2.3.0-beta02
18 ফেব্রুয়ারি, 2021
androidx.room:room-*:2.3.0-beta02
is released. Version 2.3.0-beta02 contains these commits.
নতুন বৈশিষ্ট্য
Room now has experimental support for Kotlin Symbol Processing KSP .
KSP is a replacement for KAPT to run annotation processors natively on the Kotlin compiler, significantly reducing build times.
To use Room with KSP, you can apply the KSP Gradle plugin and replace the
kapt
configuration in your build file withksp
. For example, instead ofkapt 'androidx.room:room-compiler:2.3.0-beta02'
useksp 'androidx.room:room-compiler:2.3.0-beta02'
. See the KSP documentation for more details.Note that since KSP is experimental, it is recommended to still use KAPT for production code. The reduction of build times is only applicable if there are no other processors that use KAPT. See b/160322705 for known issues.
Version 2.3.0-beta01
জানুয়ারী 27, 2021
androidx.room:room-*:2.3.0-beta01
is released. Version 2.3.0-beta01 contains these commits.
নতুন বৈশিষ্ট্য
- Auto Closable Databases : Room now has the ability to close databases that are not accessed after a given amount of time. This is an experimental feature and can be enabled by calling
RoomDatabase.Builder#setAutoCloseTimeout()
. This feature is useful for applications with multiple databases.
বাগ ফিক্স
- Fix an issue where Dao methods with multiple
@Update
or@Delete
methods with different conflict strategies would generate code with only one of the strategies, effectively ignoring the defined one. ( /I0b90d , b/176138543 )
Version 2.3.0-alpha04
16 ডিসেম্বর, 2020
androidx.room:room-*:2.3.0-alpha04
is released. Version 2.3.0-alpha04 contains these commits.
নতুন বৈশিষ্ট্য
- Room now offers a general callback API
RoomDatabase.QueryCallback
, for when queries are about to execute, which can be useful for logging in debug builds. The callback can be set viaRoomDatabase.Builder#setQueryCallback()
. ( Iaa513 , b/174478034 , b/74877608 ) - Room will now default to using an Enum to String and vice versa type converter if none is provided. If a type converter for an enum already exists, Room will prioritize using it over the default one. ( b/73132006 )
Known Issue
- If a one-way type converter for reading already exists for the Enum, Room might accidentally use the built-in String to Enum converter which might not be desired. This is a known issue and can be fixed by making it a two-way converter. See: b/175707691
বাগ ফিক্স
- Fixed an issue where Room would incorrectly disabled incremental annotation processing in newer JDK versions. ( b/171387388 )
- Fixed an issue with Room finding the generated class when multiple class loaders are used. Thanks for the fix 'Serendipity | 892449346@qq.com'! ( b/170141113 )
- Fixed an issue where Room would generate incorrect code when a Kotlin
@Dao
had a base class whose generics are primitives in the JVM. ( b/160258066 )
বাহ্যিক অবদান
- Room will now default to using
beginTransactionNonExclusive
if WAL mode is enabled and API is 16 or more. Thanks to 'Ahmed I. Khalil | ahmedibrahimkhali@gmail.com'! ( b/126258791 )
Version 2.3.0-alpha03
অক্টোবর 14, 2020
androidx.room:room-*:2.3.0-alpha03
is released. Version 2.3.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
Room now has APIs for providing instances of type converters such that the app can control their initialization. To mark a type converter that will be provided to Room use the new annotation
@ProvidedTypeConverter
. Thanks to 'mzgreen yairobbe@gmail.com '. ( Ie4fa5 , b/121067210 )Room now has APIs for creating a database using a pre-packaged database read from an input stream. This allows for cases such as when the pre-package database is gzipped. Thanks to 'Ahmed El-Helw ahmedre@gmail.com ' ( 3e6792 , b/146911060 )
এপিআই পরিবর্তন
Added missing target to
@ForeignKey
annotation preventing its usage outside of the@Entity
annotation. ( Iced1e )The field
mCallbacks
inRoomDatabase.java
is now hidden. ( d576cb , b/76109329 )
বাগ ফিক্স
Update to TypeConverters documentation to clarify that TypeConverters can only be used to convert columns / fields and not rows. ( I07c56 , b/77307836 )
Update to the DaoProcessor to fix compiler error on Dao with a generic super type with Kotlin "primitives". ( Ice6bb , b/160258066 )
Update add/remove observer methods documentation to clarify threading ( Ifd1d9 , b/153948821 )
Fix an issue with Room incorrectly validating FTS tables that declared their rowid column. ( d62ebc , b/145858914 )
External Contributions
Fix upper/lowercase locale issues related to Turkish ( 5746e3 ), b/68159494
Replace the
ConcurrentHashMap
insideRoomDatabase
withCollections.synchronizedMap()
to avoid issues on Android Lollipop ( d1cfc7 , b/162431855 )Add a onOpenPrepackagedDatabase callback for when a prepackaged DB is copied. ( I1ba74 , b/148934423 )
Version 2.3.0-alpha02
22 জুলাই, 2020
androidx.room:room-*:2.3.0-alpha02
is released. Version 2.3.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
- RxJava3 Support : Room now supports RxJava3 types. Similar to RxJava2 you can declare DAO methods whose return type are Flowable, Single, Maybe and Completable. Additionally a new artifact
androidx.room:room-rxjava3
is available to support RxJava3. ( b/152427884 )
এপিআই পরিবর্তন
- Declaring a
@TypeConverter
in Kotlin Object class is now supported. ( b/151110764 ) -
Room
incremental annotation processing option is now ON by default. ( b/112110217 )
Version 2.3.0-alpha01
জুন 10, 2020
androidx.room:room-*:2.3.0-alpha01
is released. Version 2.3.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
Paging 3.0 Support : Room will now support generating implementations for
@Query
annotated methods whose return type isandroidx.paging.PagingSource
.@Dao interface UserDao { @Query("SELECT * FROM users ORDER BY id ASC") fun pagingSource(): PagingSource<Int, User> }
এপিআই পরিবর্তন
-
@RewriteQueriesToDropUnusedColumns
is a new convenient annotation that makes Room rewrite the '*' projection in a query such that unused columns in the result are removed. - The processor option
room.expandProjection
is now deprecated. Use@RewriteQueriesToDropUnusedColumns
as a replacement for Room optimizing queries with star projections. Note that@RewriteQueriesToDropUnusedColumns
does not replace the column conflict solutionroom.expandProjection
offered with regards to return types that contained@Embedded
fields.
বাগ ফিক্স
- Fixed a bug where Room would not correctly detect the JDK version used to enable incremental annotation processor. Thanks to Blaz Solar (me@blaz.solar) ( b/155215201 )
- Room now embeds its ANTLR dependency with the annotation processor to avoid version conflicts with other processors that also use ANTLR. ( b/150106190 )
সংস্করণ 2.2.6
সংস্করণ 2.2.6
16 ডিসেম্বর, 2020
androidx.room:room-*:2.2.6
is released. Version 2.2.6 contains these commits.
বাগ ফিক্স
- Fixed an issue where Room would incorrectly disabled incremental annotation processing in newer JDK versions. ( b/171387388 )
সংস্করণ 2.2.5
সংস্করণ 2.2.5
18 মার্চ, 2020
androidx.room:room-*:2.2.5
is released. Version 2.2.5 contains these commits.
বাগ ফিক্স
- Make
MultiInstanceInvalidationService
directBootAware. Thanks to 'Mygod contact-git@mygod.be ' ( b/148240967 ) - Fixed a bug that would cause a crash when multi-instance invalidation was enabled and the database contained a FTS entity. ( b/148969394 )
- Fixed an issue when loading the SQLite native libraries in the Room annotation processor that would cause the compiler to crash due to parallel compilations. ( b/146217083 )
Version 2.2.4
Version 2.2.4
ফেব্রুয়ারী 19, 2020
androidx.room:room-common:2.2.4
, androidx.room:room-compiler:2.2.4
, androidx.room:room-guava:2.2.4
, androidx.room:room-ktx:2.2.4
, androidx.room:room-migration:2.2.4
, androidx.room:room-runtime:2.2.4
, androidx.room:room-rxjava2:2.2.4
, and androidx.room:room-testing:2.2.4
are released. Version 2.2.4 contains these commits.
বাগ ফিক্স
- Fixed an issue with suspending transactions where they would deadlock if the coroutine was canceled quickly before the transaction actually started. ( b/148181325 )
- Fixed an issue with the @Generated being wrongly used when building with JDK 9. ( b/146538330 )
- Fixed an issue where Room would generate incorrect code when a DAO interface in Kotlin had a concrete function. ( b/146825845 )
Version 2.2.3
Version 2.2.3
18 ডিসেম্বর, 2019
androidx.room:room-*:2.2.3
is released. Version 2.2.3 contains these commits .
বাগ ফিক্স
- Fixed a bug where Room would fail to validate a database that had not gone through any migration and contained a legacy hash with indices in its schema. ( b/139306173 )
সংস্করণ 2.2.2
সংস্করণ 2.2.2
নভেম্বর 20, 2019
androidx.room:room-*:2.2.2
is released. Version 2.2.2 contains these commits .
বাগ ফিক্স
- Fixed a bug where collecting a one-to-one relationship with more than 999 rows would cause Room to return null relating items. ( b/143105450 )
সংস্করণ 2.2.1
সংস্করণ 2.2.1
23 অক্টোবর, 2019
androidx.room:room-*:2.2.1
is released. Version 2.2.1 contains these commits .
বাগ ফিক্স
- Fixed a bug where Room would incorrectly warn about
CURSOR_MISMATCH
with the compiler optionexpandProjection
turned ON. ( b/140759491 ) - Added a retry mechanism for handling the missing native library used for verifying queries during compile time.
সংস্করণ 2.2.0
সংস্করণ 2.2.0
9 অক্টোবর, 2019
androidx.room:room-*:2.2.0
is released. Version 2.2.0 contains these commits .
Important changes since version 2.1.0
- Pre-packaged Database : Two new APIs in
RoomDatabase.Builder
are now available for creating aRoomDatabase
given an already populated database file.createFromAsset()
is for when the pre-populated database file is in the assets folder of the APK, whilecreateFromFile()
is for when the file is in an arbitrary location. The usages of these API change the behaviour of destructive migrations such that during a fallback migration, Room will try to re-copy the pre-populated database if available, otherwise it fallbacks to just dropping and re-creating all tables. b/62185732 - Schema Default Values :
@ColumnInfo
now has a new propertydefaultValue
that can be used to specify the default value of a column. Default values are part of a database schema and will be validated during migrations if specified. b/64088772 - Many-to-Many Relations :
@Relation
now has a new propertyassociateBy
, that takes in a new annotation@Junction
, used to declare a relation that needs to be satisfied via a junction table (also known as a join table). b/69201917 - One-to-One Relations : The restriction in POJO fields annotated with
@Relation
to be of typeList
orSet
has been lifted, effectively allowing single-value relations to be represented. b/62905145 - Target Entity : The DAO annnotations
@Insert
,@Update
and@Delete
now has a new propertytargetEntity
, that allows specifying the target table the DAO method is meant to act on. This allows for the parameters of those DAO methods to be arbitrary POJOs which will be interpreted as partial entities. In practice, this allows partial inserts, deletes and updates. b/127549506 - Coroutines Flow :
@Query
DAO methods can now be of return typeFlow<T>
. The returned Flow will re-emit a new set of values if the observing tables in the query are invalidated. Declaring a DAO function with aChannel<T>
return type is an error, Room instead encourages you to useFlow
and then use the neighboring functions to convert theFlow
into aChannel
. b/130428884 - Gradle Incremental Annotation Processor : Room is now a Gradle isolating annotation processor and incrementability can be enabled via the processor option
room.incremental
. See Room Compiler Options for more information. If you encounter any issues please file a bug here . We plan to enable incrementability by default in a future, stable version. b/112110217 - Expanding Projections : A new experimental compiler option
room.expandProjection
was added that causes Room to rewrite a query with a star projection to only contain the columns in the returning type POJO. For example, for a DAO method with@Query("SELECT * FROM Song")
that returns a POJO namedSongIdAndTitle
with only two fields. Then Room will rewrite the query toSELECT id, title FROM Song
such that the minimum set of columns to satisfy the return type are fetched. This essentially eliminates theCURSOR_MISMATCH
warning that is presented when the query returns extra columns that do not match any field in the returning POJO type.
Version 2.2.0-rc01
5 সেপ্টেম্বর, 2019
androidx.room:room:2.2.0-rc01
is released. The commits included in this version can be found here .
No public changes since Room 2.2.0-beta01
.
Version 2.2.0-beta01
22 আগস্ট, 2019
androidx.room:room-*:2.2.0-beta01
is released. The commits included in this version can be found here .
বাগ ফিক্স
- Fixed a bug where a Coroutine Flow query would stop reemitting new values after a certain time. ( b/139175786 )
- Fixed a bug where Room would not accept a legacy schema hash code while opening a database that had not gone a migration since Room 1.0, causing a runtime crash due to invalid schema. ( b/139306173 )
Version 2.2.0-alpha02
7 আগস্ট, 2019
androidx.room:room-*:2.2.0-alpha02
is released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
- Coroutines Flow :
@Query
DAO methods can now be of return typeFlow<T>
. The returned Flow will re-emit a new set of values if the observing tables in the query are invalidated. Declaring a DAO function with aChannel<T>
return type is an error, Room instead encourages you to useFlow
and then use the neighboring functions to convert theFlow
into aChannel
. b/130428884 - Expanding Projections : A new experimental compiler option
room.expandProjection
was added that causes Room to rewrite a query with a star projection to only contain the columns in the returning type POJO. For example, for a DAO method with@Query("SELECT * FROM Song")
that returns a POJO namedSongIdAndTitle
with only two fields. Then Room will rewrite the query toSELECT id, title FROM Song
such that the minimum set of columns to satisfy the return type are fetched. This essentially eliminates theCURSOR_MISMATCH
warning that is presented when the query returns extra columns that do not match any field in the returning POJO type. -
onDestructiveMigrate
is a new callback API added toRoomDatabase.Callback
for when Room destructively migrates a database. b/79962330
বাগ ফিক্স
- Fixed a bug where Room would generate incorrect code using a method as field setter when the field is protected. b/136194628
- Fixed a bug that caused the InvalidationTracker to throw a NPE in a second process when multi-instance invalidation was enabled and the invalidation Service was killed. b/137454915
- Fixed a bug where Room would not correctly identify the return type of an inherited suspend function annotated with
@RawQuery
. b/137878827 - Updated the generated code for
@Relation
when the relating key is of type BLOB to use aByteBuffer
that is comparable. b/137881998 - Fixed a bug where Room would complain about missing setters on POJOs used as partial entity parameters of
@Insert
,@Update
and@Delete
. b/138664463 - Fixed a bug where Room would complain about missing getters & setters for an ignored column via
@Entity
when the entity class was used in certain DAO methods. b/138238182 - Fixed a bug where Room would not correctly convert named binding args to positional args causing a runtime exception when executing a query with re-used parameters. b/137254857
Version 2.2.0-alpha01
10 জুলাই, 2019
নতুন বৈশিষ্ট্য
- Pre-packaged Database : Two new APIs in
RoomDatabase.Builder
are now available for creating aRoomDatabase
given an already populated database file.createFromAsset()
is for when the pre-populated database file is in the assets folder of the APK, whilecreateFromFile()
is for when the file is in an arbitrary location. The usages of these API change the behaviour of destructive migrations such that during a fallback migration, Room will try to re-copy the pre-populated database if available, otherwise it fallbacks to just dropping and re-creating all tables. b/62185732 - Schema Default Values :
@ColumnInfo
now has a new propertydefaultValue
that can be used to specify the default value of a column. Default values are part of a database schema and will be validated during migrations if specified. b/64088772Note: If your database schema already has default values, such as those added via
ALTER TABLE x ADD COLUMN y INTEGER NOTNULL DEFAULT z
, and you decide to define default values via@ColumnInfo
to the same columns, then you might need to provide a migration to validate the unaccounted default values. See Room Migrations for more information. - Many-to-Many Relations :
@Relation
now has a new propertyassociateBy
, that takes in a new annotation@Junction
, used to declare a relation that needs to be satisfied via a junction table (also known as a join table). b/69201917 - One-to-One Relations : The restriction in POJO fields annotated with
@Relation
to be of typeList
orSet
has been lifted, effectively allowing single-value relations to be represented. b/62905145 - Target Entity : The DAO annnotations
@Insert
,@Update
and@Delete
now has a new propertytargetEntity
, that allows specifying the target table the DAO method is meant to act on. This allows for the parameters of those DAO methods to be arbitrary POJOs which will be interpreted as partial entities. In practice, this allows partial inserts, deletes and updates. b/127549506 - Gradle Incremental Annotation Processor : Room is now a Gradle isolating annotation processor and incrementability can be enabled via the processor option
room.incremental
. See Room Compiler Options for more information. If you encounter any issues please file a bug here . We plan to enable incrementability by default in a future, stable version. b/112110217
বাগ ফিক্স
- Room will no longer propagate the
EmptySetResultException
to the global error handler when the Rx stream of a query has been disposed before the query is complete. b/130257475 - Fixed a bug where Room would show an incorrect error message when a suspend DAO function annotated with
@RawQuery
didn't have a return type. b/134303897 - Room will no longer generate DAO adapters with raw types. b/135747255
সংস্করণ 2.1.0
সংস্করণ 2.1.0
13 জুন, 2019
Room 2.1.0 is released with no changes from 2.1.0-rc01
. The commits included in the version can be found here .
Important changes since 2.0.0
- FTS : Room now supports entities with a mapping FTS3 or FTS4 table. Classes annotated with
@Entity
can now be additionally annotated with@Fts3
or@Fts4
to declare a class with a mapping full-text search table. FTS options for further customization are available via the annotation's methods. - Views : Room now supports declaring a class as a stored query, also known as a view , using the
@DatabaseView
annotation. - Couroutines : DAO methods can now be suspend functions. Include
room-ktx
in your dependencies to take advantage of this functionality. The ktx artifact also provides the extension functionRoomDatabase.withTransaction
for performing database transactions within a coroutine. - Auto Value : Room now supports declaring AutoValue annotated classes as entities and POJOs. The Room annotations
@PrimaryKey
,@ColumnInfo
,@Embedded
and@Relation
can now be declared in an auto value annotated class's abstract methods. Note that these annotation must also be accompanied by@CopyAnnotations
for Room to properly understand them. - Additional Async Support : DAO methods annotated with
@Insert
,@Delete
or@Update
, along with@Query
containingINSERT
,DELETE
orUPDATE
statements, now support Rx return typesCompletable
,Single
,Maybe
, and Guava's return typeListenableFuture
, and they can also be suspend functions. -
enableMultiInstanceInvalidation
is a new API inRoomDatabase.Builder
to enable invalidation across multiple instances of RoomDatabase using the same database file. -
fallbackToDestructiveMigrationOnDowngrade
is a new API inRoomDatabase.Builder
to automatically re-create the database if a downgrade happens. -
ignoredColumns
is a new API in the@Entity
annotation that can be used to list ignored fields by name. - Room will now properly use Kotlin's primary constructor in data classes avoiding the need to declare the properties as
vars
.
Version 2.1.0-rc01
29 মে, 2019
বাগ ফিক্স
- Fixed a Room initialization error that might occur due to an already setup temp_store configuration. b/132602198
- Fixed a double quote usage warning for users with SQLite 3.27.0 and above. b/131712640
- Fixed a bug where the InvalidationTracker would cause a crash when multiple invalidation checks would occur in parallel. b/133457594
Version 2.1.0-beta01
7 মে, 2019
androidx.room 2.1.0-beta01
is released with no changes from 2.1.0-alpha07. The commits included in this version can be found here .
Version 2.1.0-alpha07
25 এপ্রিল, 2019
API / Behavior Changes
- The extension function
RoomDatabase.withTransaction
has been changed to no longer take a function block with aCoroutineScope
as receiver. This prevents skipping the additionalcoroutineScope { }
wrapper required to run things in the transaction block concurrently.
বাগ ফিক্স
- Fixed a bug where Room would fail to match a TypeConverter for a Kotlin DAO function containing a parameter of Collection type. b/122066791
Version 2.1.0-alpha06
22 মার্চ, 2019
API / Behavior Changes
- Async transaction queries are now serialized such that Room will not use more than one thread for executing database transactions.
RoomDatabase.Builder.setTransactionExecutor(Executor)
was added to allow configuring the executor to be used for transactions. -
RoomDatabase.runInTransaction(Callable)
will no longer wrap checked exceptions into RuntimeExceptions. b/128623748
বাগ ফিক্স
- Fixed a bug where the invalidation tracker would stop observing a content table if observers for both the content table and an external content FTS table were added. b/128508917
- Updated
Room
SQLite grammar to match SQLite 3.24.0. b/110883668
Version 2.1.0-alpha05
13 মার্চ, 2019
নতুন বৈশিষ্ট্য
- The extension function
RoomDatabase.withTransaction
allows you to safely perform database transactions within a coroutine. Room extensions functions along with coroutines support are available in theroom-ktx
artifact. - Non-abstract DAO methods annotated with
@Transaction
can now be suspend functions. b/120241587
API / Behavior Changes
- The artifact
room-coroutines
has been renamed toroom-ktx
following the same naming as other androidx artifacts. -
beginTransaction
,setTransactionSuccessful
andendTransaction
inRoomDatabase
have been deprecated in favor ofrunInTransaction
and theroom-ktx
extension functionwithTransaction
.
বাগ ফিক্স
- Fixed a bug where tokenizer arguments were being dropped if the tokenizer used was SIMPLE. b/125427014
- Fixed a bug where Room would fail to correctly identify suspending functions with parameters whos type were an inner class. b/123767877
- Fixed a bug where deferred
@Query
DAO method withINSERT
,UPDATE
orDELETE
statements were eagerly preparing the query in the main thread. b/123695593 - Fixed various bugs where Room would generate incorrect code for certain suspend functions. b/123466702 and b/123457323
- Fixed a bug where deprecated usage of methods were not being correctly suppressed in generated code. b/117602586
- Updated Room dependency of androidx.sqlite to 1.0.2 which contain fixes for correctly handling corrupted databases. b/124476912
পরিচিত সমস্যা
- Room 2.1.0-alpha05 depends on the
kotlinx-metadata-jvm
artifact which is not currently available in Maven Central ( KT-27991 ). This dependency can be resolved by addingmaven { url "https://kotlin.bintray.com/kotlinx/" }
to your project repositories.
Version 2.1.0-alpha04
25 জানুয়ারী, 2019
নতুন বৈশিষ্ট্য
- DAO methods annotated with
@Query
containingINSERT
,UPDATE
orDELETE
statements can now return async typesSingle
,Mayble
,Completable
andListenableFuture
. Additionally they can also be suspend functions. b/120227284
API / Behavior Changes
- Room will now throw an error if a non-abstract DAO method annotated with
@Transaction
returns an async type such asSingle
,Mayble
,Completable
,LiveData
orListenableFuture
. Since transactions are thread confined it is currently impossible for Room to begin and end a transaction around a function that may peform queries in different threads. b/120109336 -
OnConflictStrategy.FAIL
andOnConflictStrategy.ROLLBACK
have been@Deprecated
since they do not behave as intended with Android's current SQLite bindings. b/117266738
বাগ ফিক্স
- Fixed a bug where Room wouldn't correctly use the TypeConverter of a return type if the DAO method was a suspend function. b/122988159
- Fixed a bug where Room would incorrectly identify inherited suspend functions as non-suspending. b/122902595
- Fixed a bug where Room would generate incorrect code when an
@Embedded
field was in a parent class and used in multiple child classes. b/121099048 - Fixed an issue where the database would deadlock when invoking DAO suspend functions between a
beginTransaction()
andendTransaction()
. b/120854786
Version 2.1.0-alpha03
4 ডিসেম্বর, 2018
এপিআই পরিবর্তন
- The FTS
tokenizer
in@Fts3
/@Fts4
now takes a String instead of an Enum. This allows custom tokenizers to be used by Room. Built-in tokenizers are still defined inFtsOptions
as string constants. b/119234881
নতুন বৈশিষ্ট্য
- Couroutines : DAO methods can now be suspend functions. To support suspend functions in Room a new artifact has been released,
room-coroutines
. b/69474692 - DAO methods annotated with
@Insert
,@Delete
or@Update
now supportListenableFuture
as return type. b/119418331
বাগ ফিক্স
- Fixed a bug where Room would incorrectly attempt to find a constructor with columns in the
ignoredColumns
property of@Entity
. b/119830714 - Fixed a bug where Room would not mark DAO method parameters as final in their generated implementation. b/118015483
- Fixed a bug where
Room
processor would crash when reporting an error on a query with special symbols. b/119520136 - Fixed a bug where Room would decline other various
Collection
implementations as arguments of anIN
expression. b/119884035 - Fixed a bug where LiveData returned from Room would get garbage collected when observed forever causing it to no longer emit new data. b/74477406
- Updated
RoomDatabase
's close lock to reduce lock contention. b/117900450
Version 2.1.0-alpha02
অক্টোবর 30, 2018
নতুন বৈশিষ্ট্য
- Added support for referencing a
@DatabaseView
in a@Relation
. b/117680932
বাগ ফিক্স
- Fixed a bug where Room would perform disk I/O in the main thread when subscribing and disposing from an Rx return type. b/117201279
- Fixed a bug where Room would fail to find an appropriate type converter for a field in a Kotlin entity class. b/111404868
- Fixed a bug where Room would generate incorrect code for a
DAO
interface implementation containing a Kotlin default method that has no arguments. b/117527454 - Updated
Room
SQLite grammar parser, fixing a performance issue that would cause long build times. b/117401230
Version 2.1.0-alpha01
অক্টোবর 8, 2018
নতুন বৈশিষ্ট্য
- FTS : Room now supports entities with a mapping FTS3 or FTS4 table. Classes annotated with
@Entity
can now be additionally annotated with@Fts3
or@Fts4
to declare a class with a mapping full-text search table. FTS options for further customization are available via the annotation's methods. b/62356416 - Views : Room now supports declaring a class as a stored query, also known as a view using the @DatabaseView annotation. b/67033276
- Auto Value : Room now supports declaring AutoValue annotated classes as entities and POJOs. The Room annotations
@PrimaryKey
,@ColumnInfo
,@Embedded
and@Relation
can now be declared in an auto value annotated class' abstract methods. Note that these annotation must also be accompanied by@CopyAnnotations
for Room to properly understand them. b/62408420 - Additional Rx Return Types Support : DAO methods annotated with
@Insert
,@Delete
or@Update
now support Rx return typesCompletable
,Single<T>
andMaybe<T>
. b/63317956 - Immutable Types with
@Relation
: Room previously required@Relation
annotated fields to be settable but now they can be constructor parameters. -
enableMultiInstanceInvalidation
: Is a new API inRoomDatabase.Builder
to enable invalidation across multiple instances of RoomDatabase using the same database file. This multi-instance invalidation mechanism also works across multiple processes. b/62334005 -
fallbackToDestructiveMigrationOnDowngrade
: Is a new API inRoomDatabase.Builder
to automatically re-create the database if a downgrade happens. b/110416954 -
ignoredColumns
: Is a new API in the@Entity
annotation that can be used to list ignored fields by name. Useful for ignoring inherited fields on an entity. b/63522075
API / Behavior Changes
-
mCallback
andmDatabase
inRoomDatabase
are now@Deprecated
and will be removed in the next major version of Room. b/76109329
বাগ ফিক্স
- Fixed two issues where Room wouldn't properly recover from a corrupted database or a bad migration during initialization. b/111504749 and b/111519144
- Room will now properly use Kotlin's primary constructor in data classes avoiding the need to declare the fields as
vars
. b/105769985
সংস্করণ 2.0.0
সংস্করণ 2.0.0
অক্টোবর 1, 2018
androidx.room 2.0.0
is released with no changes from 2.0.0-rc01.
Version 2.0.0-rc01
সেপ্টেম্বর 20, 2018
androidx.room 2.0.0-rc01
is released with no changes from 2.0.0-beta01.
Version 2.0.0-beta01
জুলাই 2, 2018
API / Behavior Changes
- Added
RoomDatabase.Builder.setQueryExecutor()
to allow customization of where queries are run - Added RxJava2
Observable
support - Generated DAO and Database implementations are now final
বাগ ফিক্স
- Specify class/field name in "cannot find getter for field" error b/73334503
- Fixed RoomOpenHelper backwards compatibility with older versions of Room b/110197391
Pre-AndroidX Dependencies
For the pre-AndroidX versions of Room, include these dependencies:
dependencies {
def room_version = "1.1.1"
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version" // For Kotlin use kapt instead of annotationProcessor
// optional - RxJava support for Room
implementation "android.arch.persistence.room:rxjava2:$room_version"
// optional - Guava support for Room, including Optional and ListenableFuture
implementation "android.arch.persistence.room:guava:$room_version"
// Test helpers
testImplementation "android.arch.persistence.room:testing:$room_version"
}
সংস্করণ 1.1.1
সংস্করণ 1.1.1
জুন 19, 2018
Room 1.1.1
is identical to Room 1.1.1-rc1
.
Version 1.1.1-rc1
May 16, 2018 We highly recommend using Room 1.1.1-rc1
instead of 1.1.0
if you are using migrations.
Fixed a bug where Room would not handle post migration initialization properly b/79362399
সংস্করণ 1.1.0
Version 1.1.0-beta3
এপ্রিল 19, 2018
বাগ ফিক্স
- Fix compilation error when a Kotlin POJO references a relation entity that was defined in Java b/78199923
Version 1.1.0-beta2
5 এপ্রিল, 2018
বাগ ফিক্স
Fixed a critical bug in
Room
RxSingle
andMaybe
implementations where it would recycle the query ahead of time, causing problems if you add more than 1 observer to the returnedSingle
orMaybe
instances. b/76031240[RoomDatabase.clearAllTables][ref-clearAllTables] will not
VACUUM
the database if it is called inside a transaction. b/77235565
Version 1.1.0-beta1
21 মার্চ, 2018
এপিআই পরিবর্তন
- Based on API Review feedback,
@RawQuery
does not accept passing aString
as the query parameter anymore. You need to use [SupportSQLiteQuery][ref-SupportSQLiteQuery]. (see [SimpleSQLiteQuery][ref-SimpleSQLiteQuery] to easily create an instance of [SupportSQLiteQuery][ref-SupportSQLiteQuery] with argument support). - RoomDatabase.Builder's [fallbackToDestructiveMigrationFrom][ref-fallbackToDestructiveMigrationFrom] method now accepts
vararg int
instead ofvararg Integer
.
বাগ ফিক্স
- [RoomDatabase.clearAllTables][ref-clearAllTables] now tries to return space back to the operating system by setting a WAL checkpoint and
VACUUM
ing the database. - [
@RawQuery
][ref-RawQuery] now accepts any Pojo for theobservedEntities
property as long as the Pojo references to one or more entities via itsEmbedded
fields orRelation
s. b/74041772 - Paging: Room's DataSource implementation now correctly handles multi-table dependencies (such as relations, and joins). Previously these would fail to trigger new results, or could fail to compile. b/74128314
Version 1.1.0-alpha1
জানুয়ারী 22, 2018
নতুন বৈশিষ্ট্য
-
RawQuery
: This new API allows@Dao
methods to receive the SQL as a query parameter b/62103290 , b/71458963 -
fallBackToDestructiveMigrationsFrom
: This new API inRoomDatabase.Builder
allows for finer grained control over from which starting schema versions destructive migrations are allowed (as compared to fallbackToDestructiveMigration) b/64989640 - Room now only supports newer Paging APIs (alpha-4+), dropping support for the deprecated
LivePagedListProvider
. To use the new Room alpha, you'll need to use pagingalpha-4
or higher, and switch fromLivePagedListProvider
toLivePagedListBuilder
if you haven't already.
বাগ ফিক্স
- Improved support for Kotlin Kapt types. b/69164099
- Order of fields do not invalidate schema anymore. b/64290754